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

[xsl] Re: Replace Apostrophe Template -- very brief example...not working


Subject: [xsl] Re: Replace Apostrophe Template -- very brief example...not working
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Fri, 10 Oct 2003 21:16:36 +0200

I don't see anywhere in your code that you are calling the template named
"escape-apos".

The only way to run a named template is by using:

  xsl:call-template


=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL


"Kathy Burke" <Kathy_Burke@xxxxxxxxx> wrote in message
news:395DE57EA5BB7F4E952B7B89775350B5021E4231@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> 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



Current Thread