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

Re: XSL Transformation Question

Subject: Re: XSL Transformation Question
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Fri, 20 Feb 2004 15:08:22 -0500
pre transformation question
Eric,

At 02:05 PM 2/20/2004, you wrote:
I have a rss feed I am trying to transform, but it will not read the img and
a tags from within the description of each item

If you're referring to the pseudo-markup in your sample file (the markup-that-is-not-markup because it is escaped), you are looking at the Bane of RSS. This stuff is done this way so it won't be parsed. Not parsed, not XML -- your stylesheet can't do anything with it beyond treating it as a string.


There are extension functions in some processors that will take a string and parse it as XML -- Saxon has one -- but short of that you're kind of stuck; your options are (a) to pre-process the file into honest markup (running the risk that it won't be well-formed, but then that's the risk already) -- this can be done using the non-standard XSLT disable-output-escaping feature -- or (b) to implement an XML parser in XSLT.

Even though the XML Rec says that "It shall be easy to write programs which process XML documents", you really don't want to try (b).

I'd look for the extension function, and if I couldn't use that, I'd try (a). In any case, you'll need a strategy for dealing with feeds that break because their "markup" isn't well-formed (requiring very smart heuristics or manual intervention to fix).

Cheers,
Wendell



___&&__&_&___&_&__&&&__&_&__&__&&____&&_&___&__&_&&_____&__&__&&_____&_&&_
"Thus I make my own use of the telegraph, without consulting
the directors, like the sparrows, which I perceive use it
extensively for a perch." -- Thoreau



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.