I have an input something like this:
<applicationData>
<product>
<productCode>ABC</productCode>
<actionType>NW</actionType>
<product>
<productCode>66890</productCode>
<actionType>NW</actionType>
<product>
<productCode>66889</productCode>
<actionType>NW</actionType>
</product>
<product>
<productCode>66566</productCode>
<actionType>NW</actionType>
</product>
</product>
</product>
</applicationData>
<applicationData>
<product>
<productCode>66813</productCode>
<actionType>NC</actionType>
<product>
<productCode>66788</productCode>
<actionType>RM</actionType>
</product>
</product>
</applicationData>
Each applicationData has different levels of product. How do i get all the productcodes of the last level of product?
The first applicationData is having 3 levels of product whereas, the second one is having 2 levels.
For example, i would need to check if productCode = 66889 and productCode=66566 . How do i achieve this in XSLT ? what would be the XPath ?
I tried something like this :
applicationData/product[..//productCode='66889' and ..//productCode='66566']
But doesnt help. Please help.
If by "last level of product"" you mean a product that does not have a child product, you would be looking for:
See the demo here.