xsl-list
[Top] [All Lists]

RE: CDATA again

2005-02-11 05:05:53
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(_at_)sapient(_dot_)com] 
Sent: 11 February 2005 11:14
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] 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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>