rendering properly escaped characters


B

bwilcoxis

I have an externally generated xml file that correctly escaping
characters such as apostrophes and quotes and rendering them as
’ and '

the xml file has the following definition:
<?xml version="1.0" encoding="iso-8859-1"?>

I have tried changing that to: <?xml version="1.0" encoding="utf-8"?>
to no avail


I then take the xml file and insert it as an ASP include file via the
following:

<%
Call displayNewsXML5()
Sub displayNewsXML5()
set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.setProperty "ServerHTTPRequest", true
xml.async = false
xml.validateOnParse = true
' Load up the XML newsfeed
xml.load(Server.MapPath("/inc/news/jckgem.xml"))

set xsl = Server.CreateObject("Microsoft.XMLDOM")
xml.setProperty "ServerHTTPRequest", true
xsl.load(Server.MapPath("/inc/news/JCKstyle.xsl"))

' Write the transformation to the browser
Response.Write(xml.transformNode(xsl))
' Cleanup
Set xsl = nothing
Set xml = nothing
End Sub
%>

The xsl file contains the following:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<xsl:for-each select="/rss/channel/item">
<xsl:choose>
<xsl:when expr="childNumber(this) &lt; 2"></xsl:when>
<xsl:when expr="childNumber(this) > 7"></
xsl:when>
<xsl:eek:therwise>
<p><A>
<xsl:attribute name="HREF">
<xsl:value-of select="link"/>
</xsl:attribute>
<xsl:attribute name="target">_new</xsl:attribute>
<span class="newshead">
<xsl:value-of select="title"/>
</span>
</A>
<BR/>
<span class="news">
<xsl:value-of select="description"/>
</span>
<BR/>
<span class="newsdate">
<xsl:value-of select="pubDate"/>
</span><BR/>
</p>
</xsl:eek:therwise>
</xsl:choose>
</xsl:for-each>

</xsl:template>
</xsl:stylesheet>

What do I do to render the escaped characters as ' and " for the user?

Thanks in advance.
 
Ad

Advertisements

U

usenet

I have an externally generated xml file that correctly escaping
characters such as apostrophes and quotes and rendering them as
&amp;#8217; and &amp;#39;

the xml file has the following definition:
<?xml version="1.0" encoding="iso-8859-1"?>

I have tried changing that to: <?xml version="1.0" encoding="utf-8"?>
to no avail

I then take the xml file and insert it as an ASP include file via the
following:

<%
Call displayNewsXML5()
Sub displayNewsXML5()
set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.setProperty "ServerHTTPRequest", true
xml.async = false
xml.validateOnParse = true
' Load up the XML newsfeed
xml.load(Server.MapPath("/inc/news/jckgem.xml"))

set xsl = Server.CreateObject("Microsoft.XMLDOM")
xml.setProperty "ServerHTTPRequest", true
xsl.load(Server.MapPath("/inc/news/JCKstyle.xsl"))

' Write the transformation to the browser
Response.Write(xml.transformNode(xsl))
' Cleanup
Set xsl = nothing
Set xml = nothing
End Sub
%>

The xsl file contains the following:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<xsl:for-each select="/rss/channel/item">
<xsl:choose>
<xsl:when expr="childNumber(this) &lt; 2"></xsl:when>
<xsl:when expr="childNumber(this) > 7"></
xsl:when>
<xsl:eek:therwise>
<p><A>
<xsl:attribute name="HREF">
<xsl:value-of select="link"/>
</xsl:attribute>
<xsl:attribute name="target">_new</xsl:attribute>
<span class="newshead">
<xsl:value-of select="title"/>
</span>
</A>
<BR/>
<span class="news">
<xsl:value-of select="description"/>
</span>
<BR/>
<span class="newsdate">
<xsl:value-of select="pubDate"/>
</span><BR/>
</p>
</xsl:eek:therwise>
</xsl:choose>
</xsl:for-each>

</xsl:template>
</xsl:stylesheet>

What do I do to render the escaped characters as ' and " for the user?

Thanks in advance.

I may be mis-understanding what you're saying, but I think the escaped
characters in an XML file should look like:

’ and '

The sequences you've shown are double escaped, and I can't see from
your example why you need that.

HTH,

Pete.
--
=============================================
Pete Cordell
Tech-Know-Ware Ltd
for XML Schema to C++ data binding visit
http://www.codalogic.com/lmx/
=============================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top