[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
One easy optimisation is to convert your search string to lowercase (or upper if you prefer that) and search only for the lowercase version of the string..
In XSLT 2.0 you can use regular expressions.
Sven Waibel wrote:
De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend.
Re: [xsl] Replacing strings
Subject: Re: [xsl] Replacing strings From: Geert Josten <Geert.Josten@xxxxxxxxxxx> Date: Wed, 23 Nov 2005 16:20:55 +0100 |
One easy optimisation is to convert your search string to lowercase (or upper if you prefer that) and search only for the lowercase version of the string..
In XSLT 2.0 you can use regular expressions.
Regards, Geert
Sven Waibel wrote:
Hello,
i have a string that contains the value of CDATA field.
The string may contain following string: "Vorbedinung" "vorbedingung" "VORBEDINGUNG" and many, many other strings.
The strings should be replaced by "PRECONDITION".
I'm using following code up to now, but so i can replace just one string.
Does anybody know how to replace these strings?
Thanks Sven
<xsl:template name="replace_precond"> <xsl:param name="string" /> <xsl:param name="from" select="'Vorbedingung'" /> <xsl:param name="to" select="'PRECONDITION'" /> <xsl:choose> <xsl:when test="contains($string, $from)"> <xsl:value-of select="substring-before($string, $from)" /> <xsl:copy-of select="$to" /> <xsl:call-template name="replace_precond"> <xsl:with-param name="string" select="substring-after($string, $from)" /> <xsl:with-param name="from" select="$from" /> <xsl:with-param name="to" select="$to" /> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$string" /> </xsl:otherwise> </xsl:choose> </xsl:template>
-- Drs. G.P.H. Josten Consultant
Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 www.daidalos.nl
De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Replacing strings, Sven Waibel | Thread | Re: [xsl] Replacing strings, Sven Waibel |
[xsl] Replacing strings, Sven Waibel | Date | Re: [xsl] Replacing strings, Sven Waibel |
Month |
Keywords