xml - Formating price value in xslt -


my xml file has multiple plant tags in it. basic code is:

<plant>     <common>snakeroot</common>     <botanical>cimicifuga</botanical>     <zone>5</zone>     <light>shade</light>     <price>$5.63</price>     <availability>071114</availability> </plant> 

i want sort file based on price. if use <xsl:sort select="//price" data-type="number" order="descending" /> not sorting , reason have dollar sign infront of it. can advice on how remove or format desired result.

thanks

if it's dollar sign do

<xsl:sort select="substring-after(price, '$')" data-type="number"           order="descending" /> 

you don't want leading // makes absolute path pick out same sort key value every single plant (namely first price element in entire document), opposed relative path pick out price within particular plant it's looking @ at time.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -