[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Sorting works with String literal but not with variabl
I want to sort the following XML Dynamically: <CustomerList> <Customer> <FName>John</FName> <LName>Doe</LName> <Age>26</Age> <Phone>515-248-5025</Phone> </Customer> <Customer> <FName>Josh</FName> <LName>Ratliff</LName> <Age>24</Age> <Phone>515-909-0909</Phone> </Customer> <sortBy>Age</sortBy> //This is the element I use for determing the sort </CustomerList> This is working for me <xsl:apply-templates select="/CustomerList/Customer"> <xsl:sort select="Age" /> </xsl:apply-templates> But this is not: <xsl:variable name="sortvar"> <xsl:value-of select="//sortBy"/> </xsl:variable> <xsl:apply-templates select="/CustomerList/Customer"> <xsl:sort select="$sortvar" /> </xsl:apply-templates> Any issues with using sort like this, I tried putting an XPath directly in select of sort but still doesn't do the trick. Thanks! 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
|