Subject: Re: translate apos in string
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 16 Jan 2007 11:21:27 GMT
|
the faq has several examples showing how to do this.
after it's expanded by the XML parser,
<xsl:value-of select="
translate(translate(/node,'
',''),''', ''')"/>
means that the XSLT engine has to evalate the XPath
translate(translate(/node,'
',''),''', ''')
and ''' is a syntax error.
The intention is to turn "'" into "" (I think) so you want the XPath
translate(translate(/node,'
',''),"'", '')
which you then need to quote using xml entity references in order to put
in an XML attribute
<xsl:value-of
select="translate(translate(/node,'
',''),"'", '')"
/>
although you can remove both characters at once with
<xsl:value-of
select="translate(/node,"
'",'')"
/>
David
|