Lists Home |
Date Index |
From: "Roger L. Costello" <email@example.com>
> These two XPath expressions are equivalent:
> (a) True
> (b) False
> Answer: (b) False
This is easier to understand if you think of it in terms of set construction
and iterators. The two expressions with abbreviations eliminated are:
The first expression forms a set of all nodes that are descendant-or-self of
the document node, IOW all nodes in the document. Then, for each member
forms the set of para children, if any, then selects the first node from the
set. Obviously, this can yield multiple result nodes.
The second expression forms a set of all para nodes, then selects the first
node from the set. This can produce at most one result node.