[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Trying to replace vertical pipe...

Subject: Re: Trying to replace vertical pipe...
From: Lars Huttar <lars_huttar@xxxxxxx>
Date: Thu, 26 Aug 2010 12:43:38 -0500
Re:  Trying to replace vertical pipe...
 On 8/26/2010 11:53 AM, Paul Harvey wrote:
> Hmm, get "invalid escape character" when doing that...

Can you show us your code?
The following is an example of what David was talking about.
        <xsl:value-of select="replace('a|95|a', '\|95\|', 'x')"/>

I tested it and it works, no errors.

This is not a matter of escaping for strings (note the first argument to
replace() doesn't need it), but of escaping for regexps.
Pipe is a special character for regexps, not for string literals.

Lars

>
> ----- Original Message ----
> From: David Carlisle <davidc@xxxxxxxxx>
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Cc: Paul Harvey <paul_harv_2@xxxxxxxxx>
> Sent: Thu, August 26, 2010 12:35:35 PM
> Subject: Re:  Trying to replace vertical pipe...
>
> On 26/08/2010 17:26, Paul Harvey wrote:
>> I'm sure I can't be the first to face this, but have been unable to track down 
>> a
>> solution...
>>
> use \| to quote |

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.