XML technologies / XSLT / Introduction to XSLT 2.0 / Getting started with XSLT and XPath / The XML document as a tree / Text nodes
(Excerpt from "XSLT 2.0 & XPath 2.0" by Frank Bongers, Chapter 1.)
A text node contains only Character data. It therefore has no hierarchical internal structure. A contiguous stretch of character data in a document is represented by exactly one text node. Two text nodes cannot be directly adjacent in a tree, since they would be combined. (Note that processing can also create string literals of type xs:string. These are atomic values rather than text nodes. They can occur consecutively in a sequence and are combined only when the result is serialized.)
Also, CDATA sections, as found in XML documents, are always represented by text nodes. They have no separate node type in the document tree. Once a document has passed through the XML parser, it is no longer possible to determine whether a text node originally came from a CDATA section.
Similarly, text entities are expanded during parsing. Their replacement text takes the place of the original entity reference. Again, it is no longer possible afterward to tell whether such references existed in the document.
Copyright © Galileo Press, Bonn 2008
You may print the online version for your private use.
Otherwise, this chapter from "XSLT 2.0 & XPath 2.0 ― Das umfassende Handbuch" is subject to the same terms as the printed edition: the work and all its parts are protected by copyright. All rights are reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
Galileo Press, Rheinwerkallee 4, 53227 Bonn