|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Character substitution
Hello,
i looked at the FAQ and i found the solution to replace characters. But the variable text is empty resp. match="text()"
and then the . returns nothing.
How can i substitute the $ character?
Thanks and best regards
Sven
my xsl:
--------------------------------------------------------------
<xsl:template match="text()">
<xsl:call-template name="change" >
<xsl:with-param name="text" select="."/>
</xsl:call-template>
</xsl:template>
<xsl:template name="change">
<xsl:param name="text"/>
<xsl:value-of select="$text"/>
<xsl:choose>
<xsl:when test="contains($text, '$')">
<xsl:value-of select="substring-before($text, '$')"/>
€
<xsl:call-template name="change">
<xsl:with-param name="text" select="substring-after($text,'$')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$text"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
--------------------------------------------------------------
my xml:
--------------------------------------------------------------
<?xml version="1.0" encoding="ISO-8859-15"?>
<test>
<header>
<creation date="2005-01-10" timestamp="1105349670236" user="sven" login="sven" />
</header>
<test-t id="35" >
<numbering>1</numbering>
<name><![CDATA[TT$]]></name>
<path><![CDATA[/TT$]]></path>
</test-t>
</test>
--------------------------------------------------------------
|
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
|

Cart








