EXSLT - regexp:replace - Use Case 1

Category: example
XML Definition: regexp.replace.xml
Function or Template: function

Use Case

Source (view)

<a>
   <c>Is this EXSLT? No. no</c>
</a>

Stylesheet (view)

<xsl:template match="a">
   <xsl:apply-templates />
</xsl:template>
<xsl:template match="*">
   <out>
      <xsl:value-of select="." />
 -
               <xsl:value-of select="regexp:replace(string(.), 'no', 'g', 'yes!!!')" />
      <xsl:value-of select="regexp:replace(string(.), 'no', 'gi', 'yes!!!')" />
      <xsl:apply-templates select="*" />
   </out>
</xsl:template>

Result (view)

<out>Is this EXSLT? No. no -
         Is this EXSLT? No. yes!!!Is this EXSLT? yes!!!. yes!!!</out>

Change History

Previous Version: ..NaN.html

VersionModifiedByDetails
2001-06-24Chris Bayes

http://www.exslt.org/regexp/functions/replace/regexp.replace.use-case.1.html last modified 2001-06-24