|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Changing sort order via a parameter
I have a situation where I need to change from a text ordering to number
order depending upon a parameter. I know this value at the start of the
process, so I don't have to determine that.
I've tried the following: <xsl:for-each test="xxx"> <xsl:sort select="zzz"> <xsl:attribute name="data-type"> <xsl:choose> <xsl:when test="$A='Life'">number</xsl:when> <xsl:when test="$A='P_C'">text</xsl:when> </xsl:choose> </xsl:attribute> </xsl:sort> </xsl:for-each> Doesn't work because I'm creating an attribute on the stylesheet element. <xsl:for-each test="xxx"> <xsl:sort select="zzz"> <xsl:attribute name="data-type"> <xsl:choose> <xsl:when test="$A='Life'"> <xsl:sort select="zzz" data-type="number"?> </xsl:when> <xsl:when test="$A='P_C'"> <xsl:sort select="zzz" data-type="text"?> </xsl:when> </xsl:choose> </xsl:for-each> This doesn't work because xsl:sort is not a child of xsl:template or xsl:for-each. Is there some other method I have missed? I would like to avoid duplicating the code just to control the sort order, and this means also putting the code into a named template. ..dan --------------------------------------------------------------------------- Danny Vint http://www.dvint.com 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
|

Cart








