Currently, I have a working version of below code which check if first or second entry from input payload meets the condition. How can I make changes if I need to check for multiple entries instead of adding many OR conditions (i.e: [3], [4], [5]….etc) ?
<xsl:choose>
<xsl:when test="(wd:Entry[1]/wd:Item = 'ABC' or wd:Entry[2]/wd:Item/@wd:Descriptor = 'ABC')">
<wd:Type_Reference>
<wd:ID wd:type="Type_ID">DEF</wd:ID>
</wd:Type_Reference>
</xsl:when>
</xsl:choose>
>Solution :
If you use e.g. wd:Entry/wd:Item = 'ABC' you are checking that at least one wd:Entry/wd:Item is equal to 'ABC'.
Similarly wd:Entry/wd:Item/@wd:Descriptor = 'ABC' would check that at least one wd:Entry/wd:Item/@wd:Descriptor attribute is equal to 'ABC'.
If you want to check a certain range, then, in XPath 2 and later, you can use e.g. wd:Entry[position() = (1 to 5)]/wd:Item = 'ABC'.