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 7686499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:29:41+00:00 2026-05-31T19:29:41+00:00

XSLT / XML: convert apostrophe to a space My XML <Name>KUEN’S INTERNATIONAL</Name> USING XSL

  • 0

XSLT / XML: convert apostrophe to a space

My XML

<Name>KUEN'S INTERNATIONAL</Name>

USING XSL NEED TO CONVERT TO

<Name>KUENS INTERNATIONAL</Name>

In my xsl I have a template, where I am replacing the some special characters with spaces.

I need to replace ' apostrophe from the string, which throws an error.

I even looked into some of the answers related with the issue, some have tried with version 2.0 but I am working in 1.0

Can you tell me how these special characters works -> <>&apos;
How to convert ' apostrophe to space

<xsl:template name="stripSpecialChars">
    <xsl:param name="string" />    
    <xsl:value-of select="translate($string,'()*%$#@!~&lt;&gt;&amp;apos;,.?[]=-+/\',' ')"/> 
</xsl:template> 


<xsl:text><![CDATA[<NAME>]]></xsl:text>                         
   <xsl:call-template name="stripSpecialChars">
        <xsl:with-param name="string" select="/Name"/>
    </xsl:call-template>
<xsl:text><![CDATA[</NAME>]]></xsl:text>
  • 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-31T19:29:43+00:00Added an answer on May 31, 2026 at 7:29 pm

    Use another variable for that:

    <xsl:template name="stripSpecialChars">
      <xsl:param name="string"/>
      <xsl:variable name="stopset" select='"()*%$#@!~&lt;&gt;&apos;,.?[]=-+/\"'/>
      <xsl:value-of select="translate($string, $stopset, ' ')"/>
    </xsl:template>
    

    One line version

    <xsl:template name="stripSpecialChars">
      <xsl:param name="string"/>
      <xsl:value-of select='translate($string, "()*%$#@!~&lt;&gt;&apos;,.?[]=-+/\", " ")'/>
    </xsl:template>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to convert the following xml with xslt <item>0</item> <item>1</item> <item>2</item> <item>3</item> <item>0</item>
I have an HTML file and i want to convert to XML only using
I am trying to convert an HTML file into XML file using XSLT (Using
I need to convert default mysql modtimes into UTC formated datetimes using xslt. I
My source XML provides data column-by-column; the cells have varying heights. Using XSLT 1.0,
I am using XSLT to convert a very large XML document into (X)HTML. For
I am using XSLT to convert XML to HTML. I am having trouble figuring
How to convert XML to something else using xslt stylesheet? In C++ C# PHP
I try to convert XML to XHTML using XSLT. The XML code provided contains
I have some XML data that I want to convert to HTML with XSLT

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.