[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [xml-dev] Interoperability [long]
> Sorry, I was more crabby and obscure than usual yesterday; I had just
> returned via a red-eye flight from a DOM WG meeting in which we took yet
> another whack at namespace normalization and in matching up the DOM data
> model with the XPath data model. The combination of DOM, namespaces, and
> XPath is likely to sell quite a bit of Prozac in years to come, I fear.
> In hindsight (and in my personal opinion), the DOM probably should have
> tried harder to directly expose the prefix that a node was associated with
> when it was created or parsed; the XPath data model is somewhat cleaner in
> this regard. On the other hand, by a strict reading of the Namespace spec,
> we concluded a couple of years ago that this was un-necessary and
> potentially inefficient.
Folks using Jaxen pretty much *always* get confused the first time
they create an XPath like /foo:bar/baz:cheese, and then get nothing
selected from their document. There is definitely a lack-of-understanding
of how XPath ns-prefixes map to Document ns-prefixes. Since pretty
much everything is prefix-oriented, no one realizes that you have to
bind prefixes to uris in the context of the XPath itself, not just
An example of the prefix-orientedness of the world, many articles and
books define the URL for 'xsd' a single time, and then all examples
throughout the book only ever use the 'xsd' prefix. Folks get hung up
on the prefixes, and forget there's a ns-uri behind the scenes.)
Likewise with 'soap' or whatnot. I think the literature, at lease
this year and next, could do a better job of emphasizing that the
prefix really isn't the data, but the URI-behind-the-prefix is
what's important. Prefixes are just syntactic sugar, really.
Just my $0.02.