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

RE: Replace Apostrophe Template -- very briefexample..

Subject: RE: Replace Apostrophe Template -- very briefexample...not working
From: "Kathy Burke" <Kathy_Burke@xxxxxxxxx>
Date: Mon, 13 Oct 2003 09:11:08 -0400
replace apostrophe
Yes, I finally realized that I needed to create a variable for that element
and apply the escape-apos to that content only, then pass the variable to my
jscript.

Thanks again to Jeni for posting the script, it's great for escaping
anything needed.

Kathy

-----Original Message-----
From: Michael Kay [mailto:mhk@xxxxxxxxx]
Sent: Friday, October 10, 2003 6:00 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  Replace Apostrophe Template -- very brief
example...not working


You don't appear to have any code that calls your named template.

Michael Kay

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Kathy Burke
> Sent: 10 October 2003 19:18
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Replace Apostrophe Template -- very brief 
> example...not working
> 
> 
> Hi, since I realize I posted my example that I'm sure was too 
> long for anyone to want to slogg through it, I'm reposting 
> with a very brief example hoping someone can help me.
> 
> I'm using Jeni T's replace-apostrophe template, but when I 
> transform the
> file into html source (MSXML4) the apostrophes have NOT 
> change to \'     --
> where am I going wrong...PLEASE?
> 
> Thanks, Kathy
> 
> TEST XML*************
> ?xml version="1.0" encoding="utf-8"?>
> <?xml-stylesheet type="text/xsl" href="KB_TEST.xsl"?>
> <KB_DOC>
> <Title>Test apostrophes problem</Title>
> <para>Test Kathy's apostrophes problem.</para>
> <para>An Apostrophe's a terrible thing to waste.</para> </KB_DOC>
> 
> 
> 
> TEST XSL**************
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0" 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> 	<xsl:output method="html"/>
> 	<xsl:template match="/">
> 		<html>
> 			<head>
> 				<title>KB Test</title>
> 			</head>
> 			<body>
> 				<xsl:apply-templates/>
> 			</body>
> 		</html>
> 	</xsl:template>
> 	
> 	<xsl:template name="escape-apos">
> 		<xsl:param name="string" />
> 		<xsl:variable name="apos" select='"&apos;"' />
> 		<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>
> 	
> 	<xsl:template match="para">
> 		<p><xsl:apply-templates/></p>
> 	</xsl:template>
> 	
> </xsl:stylesheet>
> 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.