473,386 Members | 1,943 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

rendering properly escaped characters

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:otherwise>
<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:otherwise>
</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.

May 30 '07 #1
1 2618
On 30 May, 07:21, bwilco...@gmail.com wrote:
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:otherwise>
<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:otherwise>
</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/
=============================================

May 30 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Jay | last post by:
Is there a definitive list of characters that must be escaped in order to insert them into a text field in mysql? TIA, Jay
12
by: TC | last post by:
IE 6 Firefox looks just fine. I have run my html and css through the W3C validator. The html is fine and the css gets the following: "Line : 3 (Level : 1) You have no color with your...
2
by: genojoe | last post by:
In regular expressions, the Regex.Escape() and Regex.Unescape() methods convert between plain text and text with escape characters My question is simple. In HTML &lt;, & gt;, etc are escape...
0
by: DaveS | last post by:
I have a web service that returns one parameter which is defined as a string. In this string is returned an XML document (due to the fact that I have a large amount of data to pass back to the...
13
by: Oxns | last post by:
Hi, Can anyone point me at the class to convert a string so that it displays escaped chars as \r, \n etc. please Its done in the 2005 debugger so I hope its available as a class ??. Thanks...
2
by: a | last post by:
Hi everybody, I have a php script that gets the text from a form field: <?php include("global.inc.php"); pt_register( 'POST', 'test1'); echo $test1;
12
by: Torsten Bronger | last post by:
Hallchen! I need some help with finding matches in a string that has some characters which are marked as escaped (in a separate list of indices). Escaped means that they must not be part of...
9
by: Michael Goerz | last post by:
Hi, I am writing unicode stings into a special text file that requires to have non-ascii characters as as octal-escaped UTF-8 codes. For example, the letter "Í" (latin capital I with acute,...
0
by: hash4sp | last post by:
Hello ! I have a problem with the escaped charactes which I am sending to an aspx page. This is javascript escaped characters %u0646%u062A%u0627%u0626%u062C%20%u0627%u0644%u062 8%u062D%u062B ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.