W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2001

Re: CDATA sections in W3C XML Infoset

From: Philippe Le Hegaret <plh@w3.org>
Date: Wed, 28 Mar 2001 10:32:27 -0500
Message-ID: <3AC2040B.853EC636@w3.org>
To: Richard Lanyon <rgl@decisionsoft.com>
Cc: www-dom@w3.org
Richard Lanyon wrote:
> While I admit that CDATA sections are just syntactic sugar, there
> isn't any way to tell a DOM to automatically convert all its CDATA
> sections to text nodes other than physically looping through the tree
> and converting them yourself. You could do it at parse time, but that
> assumes you have control of the parser, which isn't necessarily the
> case.

DOM Level 3 is addressing this issue (controlling the parser):
http://www.w3.org/TR/2001/WD-DOM-Level-3-CMLS-20010209/load-save.html#LS-Interfaces-DOMBuilder

To remove CDATA nodes, you'll be able to use the cdata-nodes option.

Speaking of the Load and Save, I was wondering how useful it would
be to create some aliases such as:
infoset:
 false: do nothing
 true: loads the source XML conforming to the XML Infoset specification.
       This option overrides and sets:
namespaces to true
namespace-declarations to false
external-parameter-entities to false
create-entity-ref-nodes to false
entity-nodes to false
white-space-in-element-content to true
cdata-nodes to false
comments to true
charset-overrides-xml-encoding to true

others options are not specified by the infoset option:
validation
external-general-entities
validate-if-cm

canonical:
 false: do nothing
 true: loads the source XML conforming to the canonical XML specification.
   @@TBD

Philippe
Received on Wednesday, 28 March 2001 10:32:33 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:48 GMT