[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] translate quote into quote quote


Subject: RE: [xsl] translate quote into quote quote
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 12 Dec 2005 09:00:56 -0000

The only thing I can see that's obviously wrong is that

<xsl:with-param
name="substring-after($string,$apos)"/>

should be

<xsl:with-param name="string"
select="substring-after($string,$apos)"/> 

Michael Kay
http://www.saxonica.com/


> -----Original Message-----
> From: Philippe LAPLANCHE [mailto:philippe.laplanche@xxxxxxxxxxxx] 
> Sent: 12 December 2005 06:23
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] translate quote into quote quote
> 
> Hi, 
> I need to translate a string such as this one :
> I'm sad that I can't do it by myself
> Into :
> I''m sad that I can''t do it by myself
> 
> I'm using XSLT 1.0, and I tried to do something like that :
> 
> <xsl:template name="escapeQuotes">
> 		<xsl:param name="string"/>
> 		<xsl:variable name="apos" select="'"/>
> 		<xsl:if
> test="not(contains($string,$apos))"><xsl:value-of
> select="$string"/></xsl:if>
> 		<xsl:if test="contains($string,$apos)">
> 			<xsl:value-of
> select="substring-before($string,$apos)"/><xsl:value-of
> select="$apos"/><xsl:value-of select="$apos"/><xsl:call-template
> name="escapeQuotes"><xsl:with-param
> name="substring-after($string,$apos)"/></xsl:call-template>
> 		</xsl:if>
> 	</xsl:template>
> 
> 
> I'm doing something wrong ... 
> 
> Philippe


Current Thread
Keywords