[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] question about test="total[. $lt$ 10]
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|