Subject: RE: replacement example , help
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 29 Mar 2005 12:31:14 +0100
|
There's nothing obviously wrong with the named template, but there doesn't
seem to be any code that invokes it.
Michael Kay
http://www.saxonica.com/
> -----Original Message-----
> From: henry human [mailto:henry_human@xxxxxxxx]
> Sent: 29 March 2005 12:01
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: replacement example , help
>
> hello,
> In this xsl styesheet i will replace aa with the
> string cc,
> what do i wrong ,that
> i dont get cc?
> thank you to have a look on this stylesheet:
>
>
> <?xml version="1.0"?>
> <?xml-stylesheet type="text/xsl" href="replace.xsl"?>
>
>
> <document>
> <part1>
> <name>uaabb</name>
> </part1>
> </document>
>
> ------------
>
>
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output method="html"/>
>
> <xsl:template name="part1">
> <xsl:param name="name"/>
> <xsl:param name="aa"/>
> <xsl:param name="cc"/>
> <xsl:choose>
> <xsl:when test="contains($name,$aa)">
> <xsl:value-of select="substring-before($name,$aa)"/>
> <xsl:value-of select="$cc"/>
>
> <xsl:call-template name="part1">
> <xsl:with-param name="name"
> select="substring-after($name,$aa)"/>
> <xsl:with-param name="aa" select="$aa"/>
> <xsl:with-param name="cc" select="$cc"/>
> </xsl:call-template>
>
> </xsl:when>
>
> <xsl:otherwise>
> <xsl:value-of select="$name"/>
> </xsl:otherwise>
>
> </xsl:choose>
>
> </xsl:template>
>
> </xsl:stylesheet>
>
>
>
>
>
>
>
> ___________________________________________________________
> Gesendet von Yahoo! Mail - Jetzt mit 250MB Speicher kostenlos
> - Hier anmelden: http://mail.yahoo.de
|