dealing with CDATA on the client-side

Subject: dealing with CDATA on the client-side
From: Matthew Haughey <matt@xxxxxxxxxxx>
Date: Thu, 01 Jun 2000 11:53:00 -0700
I've been playing with XML & XSL for a few weeks now, but for the most part all my output to the client has been HTML/XHTML through a server-side transformation with the IIS XML ISAPI plugin.

I've been trying to convert some of the work to a client-side solution for IE5 users, but there's one thing that I can't seem to find a workable solution for.

We're storing some of the text and HTML data in the XML documents as CDATA sections like so:

   <![CDATA[this is a <a href=">test link/a>]]>

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=">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.

We'd like to be able to do all of this on the client side, but can't seem to find an appropriate solution to do this. I'm sure this has come up for others, is there a way to accomplish this entirely on the client-side with IE 5?


XSL-List info and archive:

Current Thread