Subject: RE: translate quot to apos
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Mon, 10 Jul 2000 18:05:31 +0100
|
> Is it possible, using the text output method, to translate
> all double-quote characters in a string to single-quote characters?
>
> The following does not work
> <xsl:value-of select="translate(Tag1, '"', ''')"/>
By the time the XSLT processor sees this XPath expression the XML parser has
converted it to
translate(Tag1, '"', ''')
so it's not surprising it has problems.
Best way is to use variables:
<xsl:variable name="quot">"</xsl:variable>
<xsl:variable name="apos">'</xsl:variable>
<xsl:value-of select="translate(Tag1, $quot, $apos)"/>
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|