Stylus Studio XML Editor

Table of contents

Appendices

C.6 Text and CDATASection Nodes Mapping

Text and CDATASection Nodes Mapping

Since the [InfoSet] doesn't represent the boundaries of CDATA marked sections, CDATASection nodes cannot occur from an infoset mapping.

Infoset to Text Node[top]

Infoset to Text Node

Consecutive character information items map to a Text node. The attributes of the corresponding Text node are constructed as follows:

13The table contains the mapping of an Infoset information item to a Node Attribute/Method Value
11Node.nodeName 11"#text"
11Node.nodeValue 11same as CharacterData.data
11Node.nodeType 11Node.TEXT_NODE
11Node.parentNode 11The [parent] property
11Node.childNodes 11empty NodeList
11Node.firstChild 11null
11Node.lastChild 11null
11Node.previousSibling 11null
11Node.nextSibling 11null
11Node.attributes 11null
11Node.ownerDocument 11The document information item
11Node.namespaceURI 11null
11Node.prefix 11null
11Node.localName 11null
11Node.baseURI 11null
11Node.textContent 11same as Node.nodeValue
11CharacterData.data 11 A DOMString including all [character code] contained in the character information items
11CharacterData.length 11 The number of 16-bit units needed to encode all ISO 10646 character code contained in the character information items using the UTF-16 encoding.
11Text.isElementContentWhitespace 11The [element content whitespace] property
11Text.wholeText 11same as CharacterData.data
NOTE: 

By construction, the values of the [parent] and [element content whitespace] properties are necessarily the sames for all consecutive character information items.

Text and CDATASection Nodes to Infoset[top]

Text and CDATASection Nodes to Infoset

The text content of a Text or a CDATASection node maps to a sequence of character information items. The number of items is less or equal to CharacterData.length. Text nodes contained in Attr nodes are mapped to the Infoset using the Attr.value attribute. Text nodes contained in Document nodes cannot be represented using the Infoset. The properties of the corresponding character information items are constructed as follows:

13The table contains the mapping of a Node to the Infoset Property Value
11[character code] 11The ISO 10646 character code produced using one or two 16-bit units from CharacterData.data
11[element content whitespace] 11Text.isElementContentWhitespace
11[parent] 11Node.parentNode