hiya,
I'm still stuck at this one ;-(
I want to overwrite the "numeric" value of my node with a lookup value.
<xslt>
<xsl:for-each select="PRODUCT-TYPE">
<xsl:choose>
<xsl:when test=".='6'">Bike</xsl:when>
<xsl:when test=".='7'">Car</xsl:when>
<xsl:when test=".='1'">Van</xsl:when>
<xsl:otherwise>UNDEFINED</xsl:otherwise>
</xsl:choose>
<xsl:copy-of select="." />
</xsl:for-each>
</xslt>
<InputXml>
<rows>
<row>
<PRODUCT-TYPE>6</PRODUCT-TYPE>
<PRODUCT-DATE>01/01/2003</PRODUCT-DATE>
</row>
</rows>
</InputXml>
The output is incorrect.
1) Yes, it recognises that the value "6", corresponds to value "Bike"
2) yes, it displays the value "Bike".
However:
1) it pre-pends the value "Bike" to the <PRODUCT-TYPE> node.
2) it does NOT overwrite the value "6" with the "Bike"
here is the output. (please note that the formatting on this page means
that a SINGLE row takes up 2 lines):
<outputXml>
<rows>
<row>Bike<PRODUCT-TYPE>6</PRODUCT-TYPE> <PRODUCT_DATE>30/03/2004</PRODUCT-
DATE>
</row>
</rows>
</outputXml>
I simply want the output to be:
<outputXml>
<rows>
<row>
<PRODUCT-TYPE>Bike</PRODUCT-TYPE>
<PRODUCT_DATE>30/03/2004</PRODUCT-DATE>
</row>
</rows>
</outputXml>
Can someone help?I'm in a desperate hurry to resolve this, and have scoured
the previous posts to see if i could find a similar scenario.
many thanks,
yogi
--
Message posted via http://www.dotnetmonster.com