XML technologies / XSLT / Introduction to XSLT 2.0 / Getting started with XSLT and XPath / Structure controls processing / Default rules for text and attribute nodes
(Excerpt from "XSLT 2.0 & XPath 2.0" by Frank Bongers, Chapter 1.)
When text or attribute nodes are part of a sequence to be processed, the default behavior is to extract their string value and output it as a text node in the result sequence.
This can be expressed by the following default template rule:
<xsl:template match="text()|@*">
<xsl:value-of select="."/>
</xsl:template>
For a text node, a copy is essentially created. For an attribute, its string value, the string assigned to it as its value, is copied as a text node. Note that this string is not normalized for either attribute values or text nodes. Even whitespace nodes are copied to the result document by this rule!
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