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

RE: CDATA again

Subject: RE: CDATA again
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 11 Feb 2005 12:05:53 -0000
saxon serialize
The purpose of CDATA is to indicate that contained < and > characters are
ordinary characters, not markup.

Therefore, you can't have markup inside a CDATA section.

Or in data model terms: there is no such thing as a CDATA node.

Using Saxon, you can call saxon:serialize to get a serialized representation
of an element as a string, and you can then output this string as the
contents of a text node. If you then serialize the containing document,
specifying cdata-section-elements for the relevant element, you will get the
output you want.

But why do you want it? Why do you want to disguise the XML and pretend that
it isn't XML? Why do you want to make it difficult for the recipient to
process the document? XML is designed to be nested, after all.

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

> -----Original Message-----
> From: Robert Soesemann [mailto:rsoesemann@xxxxxxxxxxx] 
> Sent: 11 February 2005 11:14
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  CDATA again
> 
> I need to produce output where some of the input node are 
> inside a valid
> CDATA comment.
> 
> E.g:
> ...
> 	<targetGroup markup="yes">                    
> 		<![CDATA[		
>                       <ul>
>                         <li>PK Bestandskunden
>                         (Postpaid+Prepaid)</li>
>                         <li>Neukunden</li>
> ...
> 
> What need I put in here to get this?
> 
> 
> 	<xsl:template match="td" mode="markup">
> 		????
> 			<xsl:copy-of select="child::node()"/>
> 		????
> 	</xsl:template>
> 
> I tried without success:
> - <xsl:text><![CDATA[</xsl:text>
> - &lt;![CDATA[
> 
> Robert

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.