RE: Two namespace-questions (revisited)
"Michael Kay" <[email protected]>
| Newsgroups | gmane.comp.java.jdom.general |
|---|---|
| Message-ID | <00ee01c7a906$b66356d0$6401a8c0@turtle> |
> Thanks - this did the biggest part of the trick - I can now > use XPath-Strings the same way I can do it in other software. As a matter of interest, what is this "other software" (which seems not to follow the XPath specification)? It seems to have had the classic effect that happens when you don't follow standards - your users get extremely confused when they encounter other products behaving in different ways. > The returned elements still contain a > > xmlns="http://www.tei-c.org/ns/1.0" > > that they don't have in the original document, tho. I think they *do* have it in the original document - in the sense that an element "has" not only its own namespace declarations but all the namespace declarations on its ancestors. When you take an element out of its parental context, you don't typically want it to move to a different namespace as a side-effect. To put it another way, in the XPath data model the following two documents are equivalent (1) <a xmlns="z"><b/></a> (2) <a xmlns="z"><b xmlns="z"/></a> (the first is just a shorthand for the second), and you wouldn't want //b to give different results for the two cases. Michael Kay http://www.saxonica.com/ _______________________________________________ To control your jdom-interest membership: http://www.jdom.org/mailman/options/jdom-interest/[email protected]