OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: quick XPath question: finding /a/b/c with a default namespace




> (Strictly speaking maybe
> XPath questions should be sent to the XSL mail list?)

(probably, and this answer will be in the FAQ for that list)


> Should the path ..find the <c> element?

No. For the reason you give, the default namespace is not used in the
Xpath. But you misunderstand the meaning of

> <a xmlns="dummyNamespace">


> So the default namespace is not used and none of the QNames in the document
> or the path have namespace prefixes, so the namespace URI is null for all
> the QNames.

whether or not a prefix is used has no effect on the namepace URI.
The namespace URI on all of the elements a  b  and c in your example is
dummyNamespace, so the Xpath you require is

x:a/x:b/x:c

where x: is the prefix assigned to the namepace URI dummyNamespace in
the stylesheet.


David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.