xsl-list
[Top] [All Lists]

Re: [xsl] Escaping Characters in replace()

2013-10-15 12:27:10
On 15/10/2013 17:44, Nathan Tallman wrote:
Thank you, David. Unfortunately, I still get ". after processing...

Presumably the template never matched.

(I'm transforming XML to HML, btw.)

Also, a question. Why didn't you need to escape the period in the
third argument of replace()?

You need \. to mean a literal . in a regular expression, not in the replacement text.

> (When I inert one, my processor throws an
error; so, I understand it's wrong, but not why. Also, I seem to be
able to delete the backslash in front of the period in the second
argument without causing problems... Why is that?)

". is a legal regex but matches a " followed by any character

replace(.,'"."','."')

would change "x to ."


David

google plus: https:/profiles.google.com/d.p.carlisle

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