xsl-list
[Top] [All Lists]

Re: [xsl] Trying to replace vertical pipe...

2010-08-26 11:34:11
Paul Harvey wrote:
I'm sure I can't be the first to face this, but have been unable to track down a solution...

I'm trying to replace the string "|95|" with a single character but the "replace()" function seems to interpret the vertical bars as "or" and won't allow it, complaining about a "zero-length string".

How would I escape |95| in order for it to be treated it as a string and enable it to be replaced?

In general you can use a function like http://www.xsltfunctions.com/xsl/functx_escape-for-regex.html to escape any characters that usually carry a meaning for the regular expression.

--

        Martin Honnen
        http://msmvps.com/blogs/martin_honnen/

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