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

Re: Copy CDATA nodes from XML to XML format w/ XALAN

Subject: Re: Copy CDATA nodes from XML to XML format w/ XALAN
From: Morten Primdahl <morten@xxxxxxx>
Date: Mon, 04 Mar 2002 13:42:09 +0100
xml format

Thanks for the pushing me in the right direction Mike, it's really appreciated. I've been having a lot of fun with copy and copy-of!

I added a call-template element to the <xsl:template match="text()">
example you gave, and can now succesfully perform some search/replace
on the output being generated. More specifically I can escape all
quotes contained in the text elements within data element.

Ie. the following

<data>
<a>
 <b>"Bub"</b>
</a>
</data>

Gets translated to <a><b>\"Bub\"</b></a> - which is what I want it
to. But if one of the descendants of the data element contain an
attribute, I need to escape the quotes used there as well, eg.

<data>
<a>
 <b foo="bar">"Bub"</b>
</a>
</data>

Should become <a><b foo=\"bar\">\"Bub\"</b></a> - I'm beginning to
doubt if this is at all possible as it's no longer "just content",
but syntax I'm messing with (sort of).

I tried using my search/replace template directly on the output
from the copy elements, but that just resulted in all tagged
elements getting filtered away.

I would prefer if there was some way to just treat the content
of the data element like a string value, there's no way to
have copy-of to copy the current node to a variable rather than
the output (or something similar)?

Thanks,

Morten



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.