I have simple XML file like that:
<screen>
<object attribute="String"/>
<object attribute="Relationship">
<vertices>
<vertex point_index="1" x="18" y="30" />
<vertex point_index="2" x="91" y="30" />
<vertex point_index="3" x="91" y="60" />
<vertex point_index="4" x="18" y="60" />
</vertices>
</object>
</screen>
How to correctly use XPath(1.0) count() function to receive vertices count in object with specified type? I’m trying to use the following string, but online XPath test tool (http://www.xpathtester.com/test) returns error.
count(/screen/object[@attribute="Relationship"]/vertices/*)
What seems to be wrong?
There is nothing wrong with the XPath. It is just that the testing tool you are using is not able to return number as result. Try this testing tool instead: http://www.whitebeam.org/library/guide/TechNotes/xpathtestbed.rhtm