Alex Rivera | Logout

XSLT Replace function not found

Asked 2009-07-01T13:19:07.167
16

I am writing an XSLT transformation in which I wish to use the Replace function to do a regex match and replace.

However, Visual Studio 2008 reports that

'replace()' is an unknown XSLT function.

The bit of code itself is:

<xsl:otherwise>
    <td style="border: solid 1px black; background-color:#00CC66;">
          <xsl:variable name="FeatureInfo" select="Text" />
                <xsl:value-of select="replace($FeatureInfo,'Feature=','TESTING')"/>
     </td>
 </xsl:otherwise>

Is there anything that I am doing wrong?

Thanks :)

Edit: I am using this version of XSLT, but it looks like it is Visual Studio's version that is a problem...I'll have to try to find a workaround.

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
Edit
Report

1 Answer

4

For simple string replacement the translate function (available in xslt 1.0) worked fine for me.

I used it to strip out spaces for numeric values.

answered 2010-09-24T11:31:11.837

Your Answer