[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Extract only numeric value
Please try the following XSLT 2.0 solution:
<?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="xml" indent="yes" /> <xsl:template match="x"> <year><xsl:value-of select="replace(year, '[a-zA-Z]', '')" /></year> </xsl:template> </xsl:stylesheet> When this is applied to input XML: <x> <year>X2A007a</year> </x> The output produced is: <year>2007</year> Any alphabetic characters anywhere, are replaced by an empty string (''). On 5/24/07, J. S. Rawat <jrawat@xxxxxxxxxxxxxx> wrote: Dear All, I would like a help about to extract numeric value.
|
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
|