Description
Change XML tree construction so CDATA tokens can be represented as CDATASection nodes instead of always being flattened into text nodes.
Proposed behavior:
- when parsing CDATA, create CDATASection nodes
- preserve CDATA lexical boundaries where possible for round-tripping
- ensure serializer can emit CDATA safely and predictably
Background
User scenarios include:
- editing documents where CDATA form is semantically important for downstream systems
- deterministic round-tripping in content pipelines
- authoring XML where escaped text and CDATA must remain distinguishable
Flattening CDATA to text is often acceptable for pure infoset processing, but many practical XML workflows depend on lexical fidelity.
Specification
Relevant specifications:
- W3C XML 1.0 (Fifth Edition), section 2.7 CDATA Sections
- DOM Standard and legacy DOM Core treatment of CDATASection as a CharacterData subtype
Description
Change XML tree construction so CDATA tokens can be represented as CDATASection nodes instead of always being flattened into text nodes.
Proposed behavior:
Background
User scenarios include:
Flattening CDATA to text is often acceptable for pure infoset processing, but many practical XML workflows depend on lexical fidelity.
Specification
Relevant specifications: