xsl-list
[Top] [All Lists]

Re: [xsl] Preserve CDATA for all elements

2006-05-14 10:48:21
No, you cannot use * to refer to all the elements, you need to specify them all as cdata-section-elements contains a list of qualified names as its value. Note that in cdata-section-elements you specify the elements in the *output* not in the *source* XML.

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


Jagdishwar (Jagsmiles) wrote:
I would like to put the <![CDATA[ elements as is in my transformed xml.
So, i had used following declaration at the beginning of the xsl:
    <xsl:output method="xml" cdata-section-elements="elementOne
elementTwo elementThree"/>

Its works fine for transforming the specified elements (i.e elementOne
elementTwo elementThree) along with the CDATA.

Actually i want to preserve CDATA as is, in all the elements my source xml.
But Its not very comfortable to add each and every element to the
cdata-section-elements attribute.

I tried using * instead of the element names.
    <xsl:output method="xml" cdata-section-elements="*"/>
but it does not work, the xslt transformer says:
"This name may not contain the '*' character"

But * works fine in other elements like xsl:strip-space
    <xsl:strip-space elements="*"/>

Is there any way, where i can specify in xsl, to preserve all the
CDATA for all the elements of the source xml document.

Thank you all

Kind Regards,
Jagdishwar,
Jagsmiles @ gmail.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>
--~--


--~------------------------------------------------------------------
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>