I have following xml content :
<root>
<content>
<figure id="fig-001">
<graphic id="fig-001-graId-001"/>
<graphic id="fig-001-graId-002"/>
<graphic id="fig-001-graId-003"/>
</figure>
<figure id="fig-002">
<graphic id="fig-002-graId-001"/>
<graphic id="fig-002-graId-002"/>
</figure>
<refs>
<ref ref-id="fig-001-graId-001" type="test"/>
<ref ref-id="fig-002-graId-001" type="test"/>
</refs>
</content>
</root>
I use oXygen
I click on an element refs/ref, for example on
<ref ref-id="fig-01-graId-001 type="test" />
I want an xpath which count 'graphic' element in figure having graphic/@id=ref/@ref-id (whene i clicked), something like that :
count(//content/figure/graphic[@id=//ref/@ref-id]/parent::/graphic) ==> 3 (parent of graphic with ref-id=fig-001-graId-001 have 3 graphic elements)
