P
piramido
Hello,
I'm in trouble with a simple XPath expression. I've got the following
XML file
<?xml version="1.0" encoding="UTF-8"?>
<a>
<b>
<c>A</c>
</b>
<b>
<c>B</c>
</b>
<b>
<c>C</c>
</b>
<b>
<c>D</c>
<c>E</c>
<c>F</c>
<c>G</c>
</b>
</a>
and I'd like to reference the c-element with content B, i.e. the
second c-element in the file. But when I execute a/b/c[2], I get the c-
element with content E (the fifth one). Can somebody give me a hint in
what is wrong with this expression. In my opinion, at first a/b/c is
evaluated, which give a set of 7 nodes (7 c-element). Out of this set
the second node is taken, which would be the c-element with content B.
Best regards,
Sascha
I'm in trouble with a simple XPath expression. I've got the following
XML file
<?xml version="1.0" encoding="UTF-8"?>
<a>
<b>
<c>A</c>
</b>
<b>
<c>B</c>
</b>
<b>
<c>C</c>
</b>
<b>
<c>D</c>
<c>E</c>
<c>F</c>
<c>G</c>
</b>
</a>
and I'd like to reference the c-element with content B, i.e. the
second c-element in the file. But when I execute a/b/c[2], I get the c-
element with content E (the fifth one). Can somebody give me a hint in
what is wrong with this expression. In my opinion, at first a/b/c is
evaluated, which give a set of 7 nodes (7 c-element). Out of this set
the second node is taken, which would be the c-element with content B.
Best regards,
Sascha