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) < 2"></xsl:when>
<xsl:when expr="childNumber(this) > 7"></
xsl:when>
<xsl
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
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.
characters such as apostrophes and quotes and rendering them as
&#8217; and &#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) < 2"></xsl:when>
<xsl:when expr="childNumber(this) > 7"></
xsl:when>
<xsl
<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
</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.