xsl:help using xsl:when

Subject: xsl:help using xsl:when
From: "Irfan A. Mohammed" <irfan@xxxxxxxxxxxx>
Date: Wed, 8 Dec 1999 12:52:52 -0500
Hi,
I need help on making selective output depending on the 
value of a particular element in the node

My XML looks like this
<?xml version="1.0" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="some.xsl"?>
<PACKAGED>
  <NVALUE>10</NVALUE>
</PACKAGED>

XSL file:
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl";
                xmlns:xslt="http://www.w3.org/TR/WD-xslt";>
  <xsl:template match="/">
    <xsl:apply-templates />
  </xsl:template>

  <xsl:template match="PACKAGED">
    <xsl:value-of select="NVALUE"/>

    <xsl:choose>
      <xsl:when test="number(NVALUE)=10">
        Yes
      </xsl:when>
    </xsl:choose>
  </xsl:template>
</xsl:stylesheet>

The "test condition" fails.

How do I test for VALUE=10 and output some test and if the value is
11, then output something else?

Thank you,
Regards,
- Irfan


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread