Hi JS,
This is a faq, though the faq entry is hidden behind the name "check for
integer", it actually shows how to use a regex to match an integer. It
should be easy to extract the integer part based on these regexes:
http://www.dpawson.co.uk/xsl/rev2/datatypes.html#d15622e974
If you don't care about the fuzz, you can also use simply (\d+) which
will greedily grab the number.
Or you can do tokenize($var, '\D+') which will give you all numbers. You
may want to change that to tokenize($var, '\D+')[.] to remove empty
items of the sequence.
Cheers,
-- Abel Braaksma
J. S. Rawat 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
--~------------------------------------------------------------------
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>
--~--
--~------------------------------------------------------------------
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>
--~--