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

Copy CDATA nodes from XML to XML format w/ XALAN

Subject: Copy CDATA nodes from XML to XML format w/ XALAN
From: Peter Carlson <carlson@xxxxxxxxxxxxxxxxx>
Date: Sun, 03 Mar 2002 12:29:14 -0800
xalan cdata
Hi,

I am trying to transform XML to XML with included CDATA and keep that CDATA
node enclosed with a CDATA tag.
I am using XALAN.

Assuming the following XML

<?xml version="1.0"?>
<top>
    <txt><![CDATA[
    crappy HTML 
    ]]>
    </txt>
</top>

When I 

<xsl:value-of select="/top/txt">
I just get the information inside of the CDATA
I.e. 
crappy HTML not <![CDATA[crappy HTML]]>

Using
<xsl:copy-of select="/top/txt">

I get the same result.

I cannot use
<![CDATA[<xsl:value-of select="."/>
Because it then views the <xsl:value-of as text not a processing
instruction.

Essentially what I want to create is

<?xml version="1.0?>
<newTop>
    <newTXT>
        <![CDATA[
    crappy HTML 
    ]]>
    </newTXT>
</newTop>

Created through an XSLT

Does anyone have an answer or suggestion on how to have the <![CDATA[ be
included in my new XML?


Thanks

--Peter


 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.