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

[CDATA section] To preserve boundaries after XSL tran

Subject: [CDATA section] To preserve boundaries after XSL transformation
From: Chizzolini Stefano <chist@xxxxxx>
Date: Thu, 14 Oct 2004 16:39:29 +0200
xsl cdata
Hi all

I'm trying to transform an XML node (see APPENDIX) preserving any CDATA
section may be encountered.
I don't want to output *all* the elements marked with the same
expanded-name, wrapping them inside CDATA sections as performed by the
xsl:output.cdata-section-elements attribute behavior ([1], chapter 16,
16.1): I just want that *any* input element with a preexisting CDATA section
is put out unchanged, that is with its damn CDATA section boundaries!

Any suggestion?

Thanks

Stefano

REFERENCES
[1] XSL Transformations (XSLT) Version 1.0,
http://www.w3.org/TR/1999/REC-xslt-19991116

APPENDIX
CDATA attempt

I've tried to transform the following "fields" element node via MSXML 4.0
(note the CDATA section inside the field element):

<documents xmlns="http://www.aaa.it/cns/xdmModel">
[...]
<page template="OFF001.pdf">
<fields>
<field name="OF1001"><![CDATA[UNITA' OPERATIVA DI BRESCIA]]></field>
[...]
</fields>
</page>
[...]
</documents>

using this XSLT:

<xsl:template match="xdm:fields">
<form src="{../@template}">
<xsl:apply-templates/>
</form>
</xsl:template>
[...]
<xsl:template match="xdm:field[@name='OF1001']">
<label x="52" y="0" width="11">
<xsl:value-of select="."/>
</label>
</xsl:template>

but (obviously) the result has lost my precious CDATA boundaries...

<form src="OFF001.pdf">
<text x="52" y="0" width="11">UNITA' OPERATIVA DI BRESCIA</text>
[...]
</form>

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.