I have the following code:
<xsl:if test=“$category = ‘FruitVeg’ and category = ‘POT’ and fType != ‘GREEN’”>
<xsl:value-of select=“productName”/> Organic Fresh
</xsl:if>
The value of productName in this case is either ‘tomato - 12a’ or ‘tomato - 1k’. It could be anything not just tomato but the ’ - 12a’ or ’ - 1k’ endings are a constant.
I want to make the value of productName return hiding the ’ - 12a’ or ’ - 1k’ endings.
I can do this for one of the possible values by coding as:
<xsl:if test=“$category = ‘FruitVeg’ and category = ‘POT’ and fType != ‘GREEN’”>
<xsl:value-of select=“translate(productName,’ - 12a’,‘’)”/> Organic Fresh
</xsl:if>
How do I do the translate for both possible values (an OR statement) or am I barking up the wrong tree? What would be the best way of doing this?
Thanks