[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
Re: escaping inverted commas
Subject: Re: escaping inverted commas
From: David Elsmore <delsmore@xxxxxxxxxxxxx>
Date: Thu, 23 Oct 2003 08:59:25 +0100
|
Kathy, Thanks for your assistance. Could you possibly providede an
example of how to call this template?
Thanks again
David
Kathy Burke wrote:
Here is a template from Jeni Tennison - works great for escaping all sorts
of things. Just call it from wherever you need it.
<xsl:template name="escape-apos">
<xsl:param name="string"/>
<xsl:variable name="apos" select='"'"' />
<xsl:choose>
<xsl:when test='contains($string, $apos)'>
<xsl:value-of select="substring-before($string,
$apos)" />
<xsl:text>\'</xsl:text>
<xsl:call-template name="escape-apos">
<xsl:with-param name="string"
select="substring-after($string, $apos)" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$string" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-----Original Message-----
From: David Elsmore [mailto:delsmore@xxxxxxxxxxxxx]
Sent: Wednesday, October 22, 2003 10:45 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: escaping inverted commas
Hi,
Given the following snippet:
<feedback>That's correct</feedback>
How can I achieve this output?
That\'s correct
Thanks in advance
--
David Elsmore
IT Development Manager
School of Social Sciences and Law
Oxford Brookes University
Tel: 01865 484176
email: delsmore@xxxxxxxxxxxxx
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format
RSS 2.0 |
|
Atom 0.3 |
|
|