|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Function to Extract integer from string
Hello Everyone, I have numerous xml documents that have content that refers to US code of Federal Regulations (CFRs) e.g. 'GENERAL ['21.197]' or 'PERMIT ['21.197 & '21.199]' Is there a simple string function that extracts integers from a string? I am trying to use a series of functions to do the same. e.g. <xsl:for-each-group select="//Title" group-by="."> <xsl:if test="contains(., ''')"> <xsl:variable name="before" select="substring-after(.,'[')"/> <xsl:variable name="after" select="substring-before($before,']')"/> <xsl:variable name="removespace" select="tokenize($after, '&')"/> <xsl:value-of select="$removespace"/> p/> </xsl:if> </xsl:for-each-group> Which produces: '21.197 '21.197 '21.199 Desired result: 21.197 21.197 21.199 I will eventually group and sort by number. Any ideas? Thanks Phil
|
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
|

Cart








