xsl-list
[Top] [All Lists]

Re: [xsl] translate apos in string

2007-01-16 04:21:43

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,'&#xA;',''),'&apos;', '&apos;')"/>

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,'&#xA;',''),&quot;'&quot;, '')"
/>

although you can remove both characters at once with

<xsl:value-of
select="translate(/node,&quot;&#xA;'&quot;,'')"
/>

David

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

<Prev in Thread] Current Thread [Next in Thread>