View Single Post
  #5 (permalink)  
Old February 9th, 2004, 05:37 PM
stevie999 stevie999 is offline
Registered User
 
Join Date: Feb 2004
Location: , , Canada.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

XSL file:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="iso-8859-1" indent="yes"/>

<xsl:template match="/">
    <order>
        <date>
            <xsl:value-of select="order/date/year"/><xsl:value-of select="order/date/month"/><xsl:value-of select="order/date/day"/>
        </date>
    <customer>Company A</customer>
    <item> <xsl:apply-templates select="order/item"/>
    <quantity><xsl:value-of select="order/quantity"/></quantity>
    </item>
    </order>
</xsl:template>

<xsl:template match="item">
<part-number>
<xsl:choose>
<xsl:when test=". = 'Production-Class Widget'">E-16-25A</xsl:when>
<xsl:when test=". = 'Economy-Class Widget'">E-16-25B</xsl:when>
<xsl:otherwise>00</xsl:otherwise>
</xsl:choose>
</part-number>
<description><xsl:value-of select="."/></description>
</xsl:template>
</xsl:stylesheet>