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(_at_)aptaracorp(_dot_)com> wrote:
Dear All,
I would like a help about to extract numeric value.
Input
<year>2007a</year>
Output
<year>2007</year>
Thanks in advance for your kind help.
...JSR
--
Regards,
Mukul Gandhi
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--