Re: Two namespace-questions (revisited)

"Kai Wörner" <[email protected]>
Newsgroups gmane.comp.java.jdom.general
Message-ID <[email protected]>
In this case it is Oxygen, actually. I simply open the document, type
"//s" into the XPath-textfield and get all "s"-Elements.

Kai



2007/6/7, Michael Kay <[email protected]>:
> > 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]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.