Monday, 19 August 2013

Removing leading 0 in XSLT

Removing leading 0 in XSLT

I have IDs that are coming through in XML files that are padded with
zeros, such as:
<dog pet_id="00005">
When parsing this, I'd like to just get the integer 5. Doing something like:
<xsl:value-of select="dog/@pet_id" />
retrieves "00005"
What's the best way to do this to just get 5?

No comments:

Post a Comment