tags:

views:

102

answers:

1

I have a bit of XSLT which is performing some magic on integer database identifiers. The relevant code snippit is

      <xsl:variable name="releaseId" select="@ID + $contentOffsetId"/>
      <xsl:attribute name="OLD_ID"> <xsl:value-of select="@ID" /> </xsl:attribute>
      <xsl:attribute name="RELEASE_ID"> <xsl:value-of select="$releaseId" />      

Unfortunately the output from this looks like this:

<ALBUM.RELEASE_LOCALE LOCALE_CODE="en_US" OLD_ID="6597512" RELEASE_ID="6.597513E6">

This result is useless to me since I won't be able to use the scientific notation entry as input to my DB import utility. I've tried a number of functions on the variable declaration, such as string(@ID + $contentOffsetId) but nothing seems to achieve the desired results.

The XSL is being executed using Saxon 8.7.

+2  A: 

Use format-number

nont
Why the hell isn't that function listed on this page: http://www.w3schools.com/Xpath/xpath_functions.asp
Jherico
@Jherico - because it is an ***XSLT*** function, not an ***XPATH*** function.
Mads Hansen
Actually, as this [page][1] points out, xpath, xslt and xquery share the same function set, which is why I felt comfortable relying on that page. However, the same page also points out that there are some built in XSLT functions that are outside the set. [1]: http://www.w3schools.com/xsl/xsl_functions.asp
Jherico