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

Re: Treat CDATA section content as node

Subject: Re: Treat CDATA section content as node
From: Dave Pawson <davep@xxxxxxxxxxxxx>
Date: Thu, 25 Feb 2010 08:05:21 +0000
Re:  Treat CDATA section content as node
On 25/02/10 05:15, Karl Stubsjoen wrote:
Is it possible to treat the content in a CDATA section as a node or
set of nodes?  The xml I am working with puts HTML markup in a CDATA
section.  Of course, these items are intended to simply copy as-is,
but I wish to translate the html into something else.

So you might have:

<xyz><![CDATA[<p>a paragraph</p><p>a paragraph</p><p>a paragraph</p>]]></xyz>

Maybe I want to tranlsate the<p>  tags into<div>  tags.  Any way to
set up a match on this, maybe use of node-set() function?

Looking for XSL 1.0 solution.

Thanks,
Karl..


Might be better to change the schema to include the (X)HTML snippet?

if you mean html, then parsing the CDATA content (I think Saxon allows
that via an extension) might produce an error due to <img> without
a closing tag.




regards


--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk

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.