[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: translate quote into quote quote

Subject: RE: translate quote into quote quote
From: "Philippe LAPLANCHE" <philippe.laplanche@xxxxxxxxxxxx>
Date: Mon, 12 Dec 2005 07:29:37 +0100
xsl value of translate
I fixed it :

<xsl:template name="escapeQuotes">
		<xsl:param name="string"/>
		<xsl:variable name="apos">'</xsl:variable>
		<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="string"
select="substring-after($string,$apos)"/></xsl:call-template></xsl:if>
	</xsl:template>

Philippe


-----Message d'origine-----
De : Philippe LAPLANCHE
Envoyi : lundi 12 dicembre 2005 07:23
@ : xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Objet : 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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.