I have XML like this:
&
I want to get first element. But with XPath expression
//*/CCC[1]I have got two elements. Each of them is the first elemet incontext. How to get first element in subset?
This is a FAQ:
The [] operator has a higher precedence (binds stronger) than the // abbreviation.
Use:
(//CCC)[1]
This selects the first (in document order) CCC element in the XML document.