[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Problem using Math functions
> Is there any transformer property that i can set at the > run time for setting the precision bounds? No, XSLT1 mandates IEEE double. Of course you can do the addition by hand, something like this (which assumes the strings have the same length, you'd need to be a bit more careful otherwise) add.xml <employee> <Arg1>1000020000300004000950000</Arg1> <Arg2>0000000000000001000060000</Arg2> </employee> add.xsl xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0"> <xsl:template match="employee"> <xsl:param name="a" select="Arg1"/> <xsl:param name="b" select="Arg2"/> <xsl:param name="c" select="0"/> <xsl:param name="t" select="''"/> <xsl:choose> <xsl:when test="string($a)"> <xsl:variable name="x" select="substring($a,string-length($a))+substring($b,string-length($b))+$c"/> <xsl:apply-templates select="."> <xsl:with-param name="a" select="substring($a,1,string-length($a)-1)"/> <xsl:with-param name="b" select="substring($b,1,string-length($b)-1)"/> <xsl:with-param name="c" select="floor($x div 10)"/> <xsl:with-param name="t" select="concat($x mod 10,$t)"/> </xsl:apply-templates> </xsl:when> <xsl:otherwise> <xsl:value-of select="$t"/> </xsl:otherwise> </xsl:choose> </xsl:template> </xsl:stylesheet> saxon add.xml add.xsl <?xml version="1.0" encoding="utf-8"?>1000020000300005001010000 ________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________
|
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
|