|
Subject: Re: [xsl] Placing mark-up in between strings From: Jeff Sese <jsese@xxxxxxxxxxxx> Date: Thu, 23 Nov 2006 18:07:39 +0800 |
<xsl:message terminate="yes"> <xsl:value-of select="$input"/> <xsl:value-of select="$word-to-replace"/> <xsl:copy-of select="$replacement"/> </xsl:message>
<xsl:sequence select="
if ( exists($words-to-replace) ) then
ati:replace-with-nodes(
ati:replace-with-nodes-1(
$input, $words-to-replace[1], $replacement[1]
),
remove($words-to-replace, 1),
remove($replacement, 1)
)
else
$input
"/>
<!--
Internal. Coroutine for ati:replace-with-nodes().
Treat a single replacement.
-->
<xsl:function name="ati:replace-with-nodes-1" as="node()*">
<xsl:param name="input" as="xs:string?"/>
<xsl:param name="word-to-replace" as="xs:string"/>
<xsl:param name="replacement" as="node()"/>
<xsl:variable name="before" select="
substring-before($input, $word-to-replace)"/>
<xsl:choose>
<xsl:when test="exists($before)">
<xsl:value-of select="$before"/>
<xsl:sequence select="$replacement"/>
<xsl:sequence select="
ati:replace-with-nodes-1(
substring-after($input, $word-to-replace),
$word-to-replace,
$replacement
)"/>
</xsl:when>
<xsl:otherwise>
<xsl:sequence select="$input"/>
</xsl:otherwise>
</xsl:choose>
</xsl:function>
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] Placing mark-up in betwee, Florent Georges | Thread | Re: [xsl] Placing mark-up in betwee, Florent Georges |
| Re: [xsl] Placing mark-up in betwee, Florent Georges | Date | Re: [xsl] Placing mark-up in betwee, David Carlisle |
| Month |