This is a FAQ.
Because of the nature of using strings in XPath/XSLT and the nature of
XML and the way they deal with entities, your statement below will not
compile. Since you use translate(), my guess is you use XSLT 1 (if not,
you can escape an apostrophe by using a doubled apostrophe).
As long as you only want to remove apostrophes (and not also quotes),
the following solution is the easiest (switching the quotes of the
attribute to apostrophes, and the quotes inside the expressions to
normal quotes):
<xsl:value-of select='translate($test, "'
", "")' />
Cheers,
-- Abel Braaksma
http://www.nuntia.nl
Jimmy wrote:
I'm trying to get rid of the ' and the line feeds in my string but
can't get it to work.
That's what I have so far:
<xsl:value-of select="
translate(translate(/node,'
',''),''', ''')"/>
The first translation of line feeds works just fine, but I can't get
rid of the apostrophe. The parser gives me an error because of the
&apos. I tried different stuff but couldn't get the proper solution.
Anyone got a hint there?
Thanks
Jimmy
--~------------------------------------------------------------------
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>
--~--
--~------------------------------------------------------------------
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>
--~--