• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2646
  • Last Modified:

How do I convert &apos in XML to an apostrophe in HTML?


I have an XML document with the following fragment:

<common_name common_name_id="600">ST.JOHN&apos;S WORT</common_name>

The XML fragment contains &apos;  I use XSLT to translate the XML into an HTML fragment but the &apos does not change to an apostrophe.

I am getting this:
ST.JOHN&apos;S WORT

and not this:
ST.JOHN'S WORT

Here is an example of the problem:
http://insidewood.lib.ncsu.edu/search/index.cfm?e=searchbygenus&q=3468

How do I use XSLT to make the correct translation?

Thanks,
Troy
0
tdsimpso
Asked:
tdsimpso
1 Solution
 
tdsimpsoAuthor Commented:
Let me add this.  This is my XSL file.

http://insidewood450.lib.ncsu.edu:9876/search/xsl.cfm
0
 
rdcproCommented:
You might have to add a disable-output-escaping="yes" to your template.  The one around the comma isn't necessary.


<xsl:if test="count(common_names/common_name) != 0">
      <xsl:text>(</xsl:text>
      <xsl:for-each select="common_names/common_name">
            <xsl:value-of select="text()"  disable-output-escaping="yes"/>
            <xsl:if test="position() != last()">
                  <xsl:text>,</xsl:text>
            </xsl:if>
      </xsl:for-each>
      <xsl:text>)</xsl:text>
</xsl:if>
0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now