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

Re: Removing namespaces without escaping CDATA???

Subject: Re: Removing namespaces without escaping CDATA???
From: "Mukul Gandhi" <gandhi.mukul@xxxxxxxxx>
Date: Fri, 6 Apr 2007 21:39:51 +0530
Re:  Removing namespaces without escaping CDATA???
The declaration, <xsl:output cdata-section-elements="qnames" /> seems
to have a shortcoming. It's not generic; in a sense that it is global
(all elements anywhere in the tree will be affected by it).

Apart from the global declaration <xsl:output
cdata-section-elements="qnames" />, I think the language should
provide this option at an element level also (something like,
xsl:element name="qname" cdata-section="yes"). The element level
declaration will override the global declaration.

Any comments please..


On 4/6/07, Martin Honnen <Martin.Honnen@xxxxxx> wrote:
ypomonh@xxxxxxxxxxx wrote:

> I' trying to remove namespaces from a document using the following
> piece of code that although works, has the side-effect of escaping
> CDATA sections (eg. "&lt;![CDATA[blah blah]]&gt;").
>
> How can I prevent CDATA from being escaped..?

I don't see why your stylesheet would escape the <![CDATA[]]>
delimiters. What should happen is that CDATA sections are converted to
normal text nodes so e.g.
  <element><![CDATA[Kibo & Xibo]]></element>
would be transformed to
  <element>Kibo &amp; Xibo</element>
There is no generic way to preserve CDATA section with XSLT as you have
to explicitly specify which elements are to be output as CDATA section
in the result document using
  <xsl:output cdata-section-elements="element-name"/>
So unless you author a stylesheet for a particular class of input
documents where you know which elements have CDATA section content so
that you can list them in the xsl:output cdata-section-elements
attribute value I don't see a way to preserve CDATA sections.



--

       Martin Honnen
       http://JavaScript.FAQTs.com/


--
Regards,
Mukul Gandhi

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.