Re: Any -complete- examples for the replace function?

"James Fuller" <[email protected]> Fri, 9 May 2008 07:22:41 +0200
Newsgroups gmane.text.xml.xslt.extensions
Message-ID <[email protected]>
u need to first ensure that the function is loaded properly

a) are u using a processor that supports EXSLT

or

b) are you importing in XSLT implementation (just that single stylesheet )

once u are past that, just make sure namespaces are declared

here is an example which u import the single XSLT implementation (note
that the package level imports do not work in EXSLT).

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:str="http://exslt.org/strings"
                extension-element-prefixes="str">

<xsl:import  href="str.replace.template.xsl"/>

<xsl:template match="/">
 REPLACE COMMA WITH DASH
<xsl:copy-of select="str:replace('a, simple, list', ', ', '-')"/>

</xsl:template>

</xsl:stylesheet>

hth, Jim Fuller