Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Math and xsl Math and xslTo: NULL Date: 6/2/2005 3:25:00 PM Hi,
In my books.xml file, each book has a price node that contains other
nodes. It looks like this:
<books>
<book>
<title>Some Title</title>
<author>One Author</author>
<author>Another Author</author>
<listprice>
<amount>1726</amount>
<formattedprice>$17.26</formattedprice>
</listprice>
<ourprice>
<amount>1531</amount>
<formattedprice>$15.31</formattedprice>
</ourprice>
</book>
<!-- other book nodes go here -->
</books>
What I'd like to do is subtract the formattedprice node of ourprice from
the formattedprice node of listprice to get the difference. This is
what I'm aiming for:
<xsl:value-of select="books/book/listprice/formattedprice -
books/book/ourprice/formattedprice"/>
However, the result I get is NaN. After checking thing out, the problem
is that the data for each formattedprice begins with the "$" character.
Is there a way that I can remove that character so that I get the
desired data?
Thanks,
Roshawn
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
