xsl-list
[Top] [All Lists]

RE: Xslt 2 stripping out non-numbers

2005-04-19 10:21:57
Will the characters to be removed always be upper-case letters?
-- 
Charles Knell
cknell(_at_)onebox(_dot_)com - email



-----Original Message-----
From:     Jim Neff <jneff(_at_)blockvision(_dot_)com>
Sent:     Tue, 19 Apr 2005 13:22:30 -0400
To:       <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Subject:  [xsl] Xslt 2 stripping out non-numbers

Greetings,

I need to strip out non-numerical values from a string.  

Here is a sample input value:  TUV0062

And what I want is :  0062  (or just 62)

Here's what I've tried so far:

for $i in tokenize(state_license_number, '\.') return xs:string( if
(string(number(.)) = 'NaN') then '' else $i)

But this does not work.  I get an empty string as a result

If I do this:

for $i in tokenize(state_license_number, '\.') return xs:string($i)

I get the whole string back so I know my "for" statement is returning
something.

What is the correct way to do this using XSLT 2?

Thanks,
Jim


--~------------------------------------------------------------------
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>
--~--