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

RE: CDATA again

Subject: RE: CDATA again
From: "Robert Soesemann" <rsoesemann@xxxxxxxxxxx>
Date: Fri, 11 Feb 2005 12:38:11 +0100
xsl cdata
OK Thanks. Could find an answer like yours in the faq.

-----Original Message-----
From: David Carlisle [mailto:davidc@xxxxxxxxx]
Sent: Freitag, 11. Februar 2005 12:28
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  CDATA again



This is a FAQ.


> I need to produce output where some of the input node are inside a
> valid CDATA comment.

You can't have nodes inside a CDATA section, you can only have character
data (hence the name).

You want to generate
	<targetGroup markup="yes">
		<![CDATA[
                      <ul>
                        <li>PK Bestandskunden
                        (Postpaid+Prepaid)</li>
                        <li>Neukunden</li>
...
    ]]>
    </targetGroup>

That is exactly the same thing as

You want to generate
	<targetGroup markup="yes">

                      &lt;ul>
                        &lt;li>PK Bestandskunden
                        (Postpaid+Prepaid)&lt;/li>
                        &lt;li>Neukunden&lt;/li>
...

    </targetGroup>

It's just a syntactic variation just as <a x="2/> and <a x = '2' /> are
syntactic variantions, that you don't directly control from XSLT.

Do you need a template mopde that writes out the character data
corresponding to the tags so

<xsl:template match="*" mode="x">
 <xsl:text>&lt;</xsl:text>
 <xsl:value-of select="name()"/>
 <xsl:text>&lt;</xsl:text>
  <xsl:apply-templates mode="x"/>
 <xsl:text>&lt;/</xsl:text>
 <xsl:value-of select="name()"/>
 <xsl:text>&lt;</xsl:text>

</xsl:template>

More complete examples, handling attributes etc are in the faq or
archives of this list.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. For more information on a proactive anti-virus
service working around the clock, around the globe, visit:
http://www.star.net.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.