[Standards] Namespace versioning

Joe Hildebrand joe.hildebrand at webex.com
Wed May 25 22:57:21 UTC 2011


On 5/25/11 2:17 PM, "Glenn Maynard" <glenn at zewt.org> wrote:

>> The first library has a bug.
> 
> An XML library supporting namespace filtering based on wildcards has a
> "bug"?  You can even do that with XPath.

I would argue that almost(1) every time you do, it's a bug in your software
using XPath. :)

Seriously, namespace URIs are just opaque strings.  They have no structure.
Two URIs that aren't an exact codepoint-for-codepoint match are completely
and totally unrelated.  Performing regex or starts-with matches on them
almost(1) always means you've got a problem with how you think about XML.


(1) I can think of cases where you don't care what the namespace is (for
example, doing syntax highlighting, where you want the namespace URIs to be
in different color).  I suppose if you wanted to highlight namespaces
starting with "jabber:" differently (because jabber: isn't a registered URI
scheme), you might use a regex containing all of the currently-registered
URI schemes.  But that's pretty edge-case, and not typical in writing XMPP
protocol handlers.

-- 
Joe Hildebrand




More information about the Standards mailing list