I have an XML that I'd like to process with XSL to count elements. I would like to count the term names that have the same parent concept/ID as the desc records (that are not type concept) with their concept/ID attribute.
XML
<rdf>
<desc type = "a">
<concept ID = "#1"/>
</desc>
<desc type = "b">
<concept ID = "#2"/>
</desc>
<desc type = "concept">
<ID>1</ID>
<term>
<info>
<name>apple</name>
<ID>1</ID>
</info>
</term>
<term>
<info>
<name>pear</name>
<ID>2</ID>
</info>
</term>
</desc>
<desc type = "concept">
<ID>2</ID>
<term>
<info>
<name>chocolate</name>
<ID>1</ID>
</info>
</term>
</desc>
</rdf>
So for this XML the program could count the term names using all desc elements that have an attribute type value "a" for example, and it would use the #1 value to lookup the desc element (type concept) with an ID element with value 1 (would need to delete the '#') and count all term names for each concept that matches this ID.