is there any way in xpath to count the following sibling of a tag and get the siblings name as well??
i tried the following to count the following sibilings:
Expression xpath2 = dog.addXPath("count(//node[@lat='53.0337395']
[@lon='8.8489255']/following-sibling)");
but it returns 0 and i expected to get as there are three following elements:
<tag k="maxspeed" v="30"/>
<tag k="maxspeed:zone" v="yes"/>
<ele k="maxspeed:zone" v="60"/>
and i do not know how to get the name of the following sibilings of a node.
xml:
<?xml version='1.0' encoding='utf-8' ?>
<osm>
<node id="25779111" lat="53.0334062" lon="8.8461545"/>
<node id="25779112" lat="53.0338904" lon="8.846314"/>
<node id="25779119" lat="53.0337395" lon="8.8489255"/>
<tag k="maxspeed" v="30"/>
<tag k="maxspeed:zone" v="yes"/>
<ele k="maxspeed:zone" v="60"/>
<node id="25779114" lat="53.334062" lon="8.841545"/>
<node id="25779117" lat="53.338904" lon="8.84614"/>
<node id="25779110" lat="53.33795" lon="8.489255"/>
<tag k="maxspeed" v="32"/>
<tag k="maxspeed:zone" v="no"/>
</osm>
To count the first set of siblings of which is called tag.
count(//node[@lat='53.0337395' and @lon='8.8489255']/following-sibling::tag[following-sibling::node])
But it will work if the pointed node is in the first set. But it will give zero if take node from the second set because there is no following-sibling::node
for them