[
Lists Home |
Date Index |
Thread Index
]
These two XPath expressions are equivalent:
//para[1]
/descendant::para[1]
(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
|