[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

dealing with CDATA (was dealing with CDATA on the client-sid

Subject: dealing with CDATA (was dealing with CDATA on the client-side)
From: eric@xxxxxxxxx (Eric Costello)
Date: Tue, 6 Jun 2000 13:29:18 -0500
cdata xmldom
Hello all,

First time poster here.

SYNOPSIS:
What do I need to do to keep an XSL transform in an MS XMLDOM environment
from converting < and > in a CDATA node to &lt; and &gt;?

DETAILS:
Using Microsoft's XMLDOM object on the server side to transform an XML file
with an XSL file and output HTML to the browser, I run into the same problem
as Matt Haughey: CDATA comes through the transform with < and > converted to
&lt; and &gt;. Here is the relevant section of his previous post to this
list (which mentions a client side occurrence of this problem, but the
problem is identical on the server):

-----------------------------------------------
<etcetera>
    <![CDATA[this is a <a href="http://yahoo.com>test link/a>]]>
</etcetera>

applying XSL on the client-side leaves unparsed HTML sitting in the text,
so it looks like this in a browser:

this is a <a href="http://yahoo.com>test link/a>

instead of

this is a test link  (test link being a hyperlink to yahoo in this example)

Now to get around this, on the server-side, we've been doing search and
replaces on &lt; and &gt; characters, and replacing them with < and > to
produce parse-able HTML when sent to the client.
------------------------------------------------

Replacing the &lt; and &gt; characters with < and > is a solution that I am
using along with Matt, but it seems pretty kludgey to me. IS there something
I should be doing in my code that would preserve the characters as they are
in the CDATA? Or is this normal and uncorrectable behavior that I need to
code around?

Thanks,
Eric

Eric Costello
eric@xxxxxxxxx
http://glish.com


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.