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


Help: OASIS Mailing Lists Help | MarkMail Help



   XPath brain teaser

[ Lists Home | Date Index | Thread Index ]

These two XPath expressions are equivalent:


(a) True
(b) False

Scroll down to see answer.

Answer: (b) False
Here's what the XPath 2.0 spec says:

"Note that the path expression //para[1] does not mean the same as the
path expression /descendant::para[1]. The latter selects the first
descendant para element; the former selects all descendant para elements
that are the first para children of their parents."

Am I the only one who answered this: (a) True?
This doesn't seem intuitive to me. Comments?  /Roger


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS