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

RE: Problem with < and > in front and after CDAT

Subject: RE: Problem with < and > in front and after CDATA section
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sun, 7 Dec 2008 10:20:44 -0000
RE:  Problem with &lt; and &gt; in front and after CDAT
> I'm having trouble parsing an RSS feed (version 2.0), over 
> which I have no control, server-side using using classic ASP 
> and XSL (version 1) Mu guess is that the problem lies in the 
> following line of the RSS feed:
> <description>&lt;![CDATA[ text ]]&gt;</description> The 
> result is that none of the content in between the description 
> tag shows up on screen. Below are the relevant pieces of code.
> 
> Is there a way in XSL 1.0 to fix the &lt; and &gt; in front 
> of and after the CDATA section? If it can only be done in 
> XSLT 2.0, I would be glad to learn how. Thanks in advance.

Frankly, since XSLT is designed for processing XML, if you need to deal with
broken XML then I think it's often better to fix it using a tool that's
designed to handle arbitrary text, such as Perl.

However, it does depend how badly broken it is. In this particular case you
could repair it using

saxon:parse("<repair>" + description + "</repair>")

Michael Kay
http://www.saxonica.com/

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-2011 All Rights Reserved.