Reputation: 107
I am facing a dilemma using the 'OR' condition in XSL.
I have the following field within within an XML file:
<PNR>
<Identifier>447000</Identifier>
</PNR>
Here is a second XML file:
<PNR>
<Identifier>812300</Identifier>
</PNR>
I have the following XSL code:
<CompanyID>
<xsl:choose>
<xsl:when test="//PNR/Identifier = '447000' or '297000'">
<xsl:text>2124</xsl:text>
</xsl:when>
<xsl:when test="//PNR/Identifier = '883000' or '769000'">
<xsl:text>2127</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>2119</xsl:text>
</xsl:otherwise>
</xsl:choose>
</CompanyID>
I am using multiple XML files with multiple 'Identifiers' values to test this. However, when i run this XSL, the value that get assigned to all XML file is 2124. The desired output should be the first file would get the 2124 assigned to it, while the second file should have 2119 since it doesn't meet the condition. Any input is much appreciated?
Upvotes: 0
Views: 100
Reputation: 8058
<xsl:when test="//PNR/Identifier = '447000' or //PNR/Identifier = '297000'">
Upvotes: 1