percent causing NAN XSLT

gomez_gretel

New Member
I am attempting to parse a document using XSLT 1.0 for insertion into a database and I am noticing an issue where any time I have a % value it will return as 'NaN' rather than the actual value. I cannot find anywhere this issue is adressedSource:\[code\]<?xml version='1.0'?><?xml-stylesheet type="text/xsl" href="http://stackoverflow.com/questions/12646654/NaNValues.xsl" ?><items> <item>10%</item> </items>\[/code\]Template:\[code\]<?xml version='1.0'?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ><xsl:output omit-xml-declaration="no" method="xml" indent="yes" version="1.0"/><xsl:template match="items"> <xsl:for-each select="item"> <xsl:call-template name="IsNaN"/> </xsl:for-each></xsl:template><xsl:template name="IsNaN"> <MyItem> <xsl:variable name="myItem" select="item" /> <xsl:value-of select="$myItem"/> </MyItem></xsl:template></xsl:stylesheet>\[/code\]Output:\[code\]<MyItem>NaN</MyItem>\[/code\]I have tried the following:\[code\]substring($myItem,1,2)substring($myItem,1,3)concat($myItem,'')string($myItem)\[/code\]The main question I have is how should be handling the percent symbol in my input file.
 
Back
Top