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

RE: enclose output of transform in CDATA section

Subject: RE: enclose output of transform in CDATA section
From: Dave Beattie <Dave.Beattie@xxxxxxxxxxx>
Date: Thu, 14 Aug 2003 14:36:19 +0100
dave beattie
Thanks for your responses. I agree it is inappropriate to place an xml
document in a CDATA section and will attempt to get the requirements
changed. However as I am producing output for a client's existing system I
will probably have to use one of the "dirty" solutions provided.

Sorry to have re-introduced a topic that has obviously been discussed so
recently.

Dave



-----Original Message-----
From: Michael Kay [mailto:mhk@xxxxxxxxx]
Sent: Thursday, August 14, 2003 2:02 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  enclose output of transform in CDATA section


We had a lengthy discussion on this last week. CDATA sections are a
particular way of representing text in text nodes. They are a way of
indicating that "<" and ">" within the text are not to be treated as
markup characters. If the thing inside a CDATA section looks like an XML
document, then the purpose of the CDATA section is to say "this isn't an
XML document even though it might look like one". Therefore, a CDATA
section can never contain an XML document, by definition.

The correct way of nesting one XML document inside another is to nest it
directly, not to hide it in a CDATA section.

But I know you're going to come back and say "don't blame me for the bad
design, I'm just the programmer who's been told to implement this".
Well, there are various techniques possible including
disable-output-escaping, saxon:serialize(), or extension functions. But
they are all dirty, and you should try and get the design improved
first.

Michael Kay

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Dave Beattie
> Sent: 14 August 2003 13:05
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  enclose output of transform in CDATA section
> 
> 
> Hi
> 
> I have to produce an output file in the following format
> 
> <Message>  
> 	<![CDATA[
> 		...xml document as generated from a transform 
> in here ...
> 	]]> 
> </Message>
> 
> Any suggestions as to how I go about doing this.
> 
> Thanks
> 
> 
> Dave
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


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

 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.