Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 278087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T01:10:54+00:00 2026-05-12T01:10:54+00:00

I am writing an XSLT transformation in which I wish to use the Replace

  • 0

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">
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T01:10:55+00:00Added an answer on May 12, 2026 at 1:10 am

    The replace function is only available in XSLT version 2.0, not in version 1.0 which is what Visual Studio uses. Just because you’ve specified version="2.0" doesn’t mean that Visual Studio supports it.

    Here’s a template on codesling that implements string-replace in XSLT 1.0. You should be able to use it but I can’t vouch for its efficiency.

    (Taken from the link above)

    <xsl:template name="string-replace-all">
      <xsl:param name="text"/>
      <xsl:param name="replace"/>
      <xsl:param name="by"/>
      <xsl:choose>
        <xsl:when test="contains($text,$replace)">
          <xsl:value-of select="substring-before($text,$replace)"/>
          <xsl:value-of select="$by"/>
          <xsl:call-template name="string-replace-all">
            <xsl:with-param name="text" select="substring-after($text,$replace)"/>
            <xsl:with-param name="replace" select="$replace"/>
            <xsl:with-param name="by" select="$by"/>
          </xsl:call-template>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="$text"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    

    You’d call it like this:

    <xsl:otherwise>
      <td style="border: solid 1px black; background-color:#00CC66;">
        <xsl:variable name="FeatureInfo" select="Text" />
        <xsl:call-template name="string-replace-all">
          <xsl:with-param name="text" select="$FeatureInfo"/>
          <xsl:with-param name="replace" select="Feature="/>
          <xsl:with-param name="by" select="TESTING"/>
        </xsl:call-template>
      </td>
    </xsl:otherwise>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple web-app in which I use struts and xslt transformation. In
I'm writing an XSLT transformation (for XSL-FO), and need to repeat something for each
Visual Studio provides a schema definition for XSLT under C:\Program Files\Microsoft Visual Studio 10.0\Xml\Schemas\xslt.xsd.
I'm writing xslt code which concatenates some string: <xsl:attribute name='src'> <xsl:value-of select=concat('url(&apos;', $imgSrc, '&apos;)')
Writing an app which takes the preview frames from camera does some transformation to
I'm writing simple transformation using XSLT 1.0 and getting strange result.. Looks like I
I'm writing an XSLT template that need to output a valid xml file for
I am writing an XSLT file to translate an XML document into an XHTML
I'm writing a template in xslt with xpath 1.0 and need to access the
I'm writing an xslt for the trx file of mstest. Apart from knowing the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.