xsl-list
[Top] [All Lists]

Re: Removing non-alphanumeric characters from attribute

2004-06-24 22:45:22
<perry(_dot_)ielati(_at_)iinet(_dot_)net(_dot_)au> wrote in message
news:1088127482(_dot_)40db81fa38afd(_at_)mail(_dot_)iinet(_dot_)net(_dot_)au(_dot_)(_dot_)(_dot_)
Hi all,

I was wondering if there is any way possible of stripping any
non-alphanumeric 
characters from an attribute. ie keep anything that is A-Z/0-9 and strip
all 
other characters like ",*-+. etc etc?

Thanks
-Pez

Use:

  translate(@x, translate(@x, $vAlphaNum, ''), '')

where @x is the attribute of the current node that you are processing and
the value of the xsl:variable named vAlphaNum is a string containing
exactly all alphanumeric characters.


Cheers,

Dimitre Novatchev.
FXSL developer, XML Insider,

http://fxsl.sourceforge.net/ -- the home of FXSL

=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL


                
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail