Re: CDATA sections in W3C XML Infoset

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 UTC