Re: [xsl] translate apos in string

Subject: Re: [xsl] translate apos in string
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Tue, 16 Jan 2007 15:46:02 +0100
Florent Georges wrote:
translate(translate(/node,'
',''),''', ''')
and ''' is a syntax error.

Mmh, doesn't translate(xxx, ''', ''') call translate() with two parameters, xxx and "', '" ? Which is of course an error, but because translate() doesn't have a version of arity 2.

This would be XSLT 2 error, because it allows escaping of ' and " by doubling it.


On XSLT 1, this escape mechanism is not allowed, causing the statement to be interpreted as:
translate(xxx, '' ', ' '')


which is an illegal concatenation of apostrophes.

-- Abel

Current Thread