[exslt] Any -complete- examples for the replace function?

James Fuller james.fuller.2007 at gmail.com
Thu May 8 23:22:41 MDT 2008


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


More information about the exslt mailing list