473,668 Members | 2,308 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.CreateOb ject("Microsoft .XMLDOM")
xml.setProperty "ServerHTTPRequ est", true
xml.async = false
xml.validateOnP arse = true
' Load up the XML newsfeed
xml.load(Server .MapPath("/inc/news/jckgem.xml"))

set xsl = Server.CreateOb ject("Microsoft .XMLDOM")
xml.setProperty "ServerHTTPRequ est", true
xsl.load(Server .MapPath("/inc/news/JCKstyle.xsl"))

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

The xsl file contains the following:

<xsl:styleshe et xmlns:xsl="http ://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<xsl:for-each select="/rss/channel/item">
<xsl:choose>
<xsl:when expr="childNumb er(this) &lt; 2"></xsl:when>
<xsl:when expr="childNumb er(this) 7"></
xsl:when>
<xsl:otherwis e>
<p><A>
<xsl:attribut e name="HREF">
<xsl:value-of select="link"/>
</xsl:attribute>
<xsl:attribut e name="target">_ new</xsl:attribute>
<span class="newshead ">
<xsl:value-of select="title"/>
</span>
</A>
<BR/>
<span class="news">
<xsl:value-of select="descrip tion"/>
</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 2645
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.CreateOb ject("Microsoft .XMLDOM")
xml.setProperty "ServerHTTPRequ est", true
xml.async = false
xml.validateOnP arse = true
' Load up the XML newsfeed
xml.load(Server .MapPath("/inc/news/jckgem.xml"))

set xsl = Server.CreateOb ject("Microsoft .XMLDOM")
xml.setProperty "ServerHTTPRequ est", true
xsl.load(Server .MapPath("/inc/news/JCKstyle.xsl"))

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

The xsl file contains the following:

<xsl:styleshe et xmlns:xsl="http ://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<xsl:for-each select="/rss/channel/item">
<xsl:choose>
<xsl:when expr="childNumb er(this) &lt; 2"></xsl:when>
<xsl:when expr="childNumb er(this) 7"></
xsl:when>
<xsl:otherwis e>
<p><A>
<xsl:attribut e name="HREF">
<xsl:value-of select="link"/>
</xsl:attribute>
<xsl:attribut e name="target">_ new</xsl:attribute>
<span class="newshead ">
<xsl:value-of select="title"/>
</span>
</A>
<BR/>
<span class="news">
<xsl:value-of select="descrip tion"/>
</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
2662
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
5317
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 background-color : body Line : 23 (Level : 1) You have no background-color with your color : div#content h1 Line : 25 (Level : 1) Family names containing whitespace should be quoted. If quoting is omitted, any whitespace characters before and after the...
2
3010
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 characters that represent < and > respectively. Are there methods in .NET that convert between plain text and escaped text?
0
863
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 caller). When I get this XML data back from the web service, in my calling app, it looks fine if the calling app is a .NET app, but when I try to call this web service from something like XML SPY, I get all sorts of escape characters returned in...
13
3000
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 Graham
2
1666
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
1850
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 any match. My current approach is to look for matches in substrings with the escaped characters as boundaries between the substrings. However, then ^ and $ in the patterns are treated wrongly. (Although I use startpos and endpos parameters for...
9
11551
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, code point 205) would come out as "\303\215". I will also have to read back from the file later on and convert the escaped characters back into a unicode string.
0
969
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 which i sent to the server side aspx page. But it changes back to the original characters ven it reach there.... is there any way to retain the escaped characters untill i send it to the database. I tried using HTTPUtility.urlEncode etc.. but it didnt...
0
8374
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8890
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8575
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8653
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7398
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5677
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4202
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2784
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1783
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.