Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2005-03-15
2
Medium Priority
?
2,586 Views
Last Modified: 2012-06-27

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
Comment
Question by:tdsimpso
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Author Comment

by:tdsimpso
ID: 13547496
Let me add this.  This is my XSL file.

http://insidewood450.lib.ncsu.edu:9876/search/xsl.cfm
0
 
LVL 26

Accepted Solution

by:
rdcpro earned 2000 total points
ID: 13549274
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

DFW AZURE MEETUP TONIGHT FRI 6PM

We will be discussing what Azure Stack is, how does it fit into the suit of offerings that Azure has currently, and where can it fit into your organizations technology stack. We will also be discussing limitations of the platform while covering various applicable scenarios.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question