Given the input XML file:
<acctInfo>
<wfInfo>
<aaa>1</aaa>
<bbb>1</bbb>
<ccc>1</ccc>
<ddd>1</ddd>
<eee>1</eee>
</wfInfo>
<acctInfo>
And the lookup file:
<fields>
<field>
<name>aaa</name>
<Updatekey>aaakey</Updatekey>
</field>
<field>
<name>bbb</name>
<Updatekey>bbbkey</Updatekey>
</field>
<field>
<name>ccc</name>
<Updatekey>ccckey</Updatekey>
</field>
</fields>
I would like to use XSLT/XPATH to count all the nodes in the input xml file that have corresponding key in the lookup table. in the above example, count should give 3. Thanks.
This transformation:
when applied on the provided XML document (corrected to be made well-formed):
produces the wanted, correct result: