This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
question about test="total[. $lt$ 10]
- To: "xsl-list at lists dot mulberrytech dot com" <xsl-list at lists dot mulberrytech dot com>
- Subject: [xsl] question about test="total[. $lt$ 10]
- From: caihongshui <caimoney at 371 dot net>
- Date: Sat, 3 Mar 2001 11:56:49 +0800
- Reply-To: xsl-list at lists dot mulberrytech dot com
xsl-list£¬
i wrote an xml document and an xsl document such as the following:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="ee.xsl"?>
<orders>
<order>
44
<total>2
</total>
</order>
<order>
13
<total>14
</total>
</order>
<order>
2
<total>65
</total>
</order>
</orders>
--------------------------------------------------------
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">aaaa
<xsl:apply-templates />
</xsl:template>
<xsl:template match="orders">
sdfsfs
<xsl:for-each select="order">
<xsl:choose>
<xsl:when test="total[. $lt$ 10]">
<hr style="color:red"/>
</xsl:when>
<xsl:when test="total[. $lt$ 20]">
<hr style="color:pink"/>
</xsl:when>
<xsl:otherwise> <hr style="color:green"/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
i wanted to see three lines :grren,pink and red.but it appeared red,pink,and green.i
know if i wrote "total" in front of [. $lt$ 10],then it would work according to the
element "total".but i don't know how to make it works accroding to the element
"order".
all of the upper is an experence ,beacause i just know a part of the attribute:
"test"
best regard
amy
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list