| Subject: Sorting on a variable From: "John E. Simpson" <simpson@xxxxxxxxxxx> Date: Sun, 15 Oct 2000 13:06:05 -0400 | 
<products>
  <product prodID="A1234">
    <name>First prod</name>
    <price curr="USD">29.95</price>
  </product>
  <product prodID="A5678">
    <name>Second prod</name>
    <price curr="GBP">29.95</price>
  </product>
  <product prodID="A9012">
    <name>Third prod</name>
    <price curr="EU">29.95</price>
  </product>
  <product prodID="A9012">
    <name>Fourth prod</name>
    <price curr="USD">50.00</price>
  </product>
</products><xsl:variable name="usd_equiv">
  <xsl:choose>
    <xsl:when test="price/@curr='USD'">
      <xsl:value-of select="price"/>
    </xsl:when>
    <xsl:when test="price/@curr='GBP'">
      <xsl:value-of select="price * 1.47275"/>
    </xsl:when>
    <xsl:when test="price/@curr='EU'">
      <xsl:value-of select="price * 0.864379"/>
    </xsl:when>
    <xsl:otherwise>Unknown Currency</xsl:otherwise>
  </xsl:choose>
</xsl:variable><xsl:variable name="product_usd">
  <xsl:for-each select="/products/product">
    <xsl:copy-of select="."/>
    <usd_equiv>
      <xsl:choose>
        <xsl:when test="price/@curr='USD'">
          <xsl:value-of select="price"/>
        </xsl:when>
        <xsl:when test="price/@curr='GBP'">
          <xsl:value-of select="price * 1.47275"/>
        </xsl:when>
        <xsl:when test="price/@curr='EU'">
          <xsl:value-of select="price * 0.864379"/>
        </xsl:when>
        <xsl:otherwise>Unknown Currency</xsl:otherwise>
      </xsl:choose>
    </usd_equiv>
  </xsl:for-each>
</xsl:variable>| Current Thread | 
|---|
| 
 | 
| <- Previous | Index | Next -> | 
|---|---|---|
| ANN: Maintenance release of Unicorn, Alexey Gokhberg | Thread | SUMMARY: Re: Sorting on a variable, John E. Simpson | 
| ANN: Maintenance release of Unicorn, Alexey Gokhberg | Date | Re: XSL-FO side-region's border que, MURAKAMI Shinyu | 
| Month |