Name

xsl:value-of

Synopsis

<xsl:value-of
   select = "expression"
   disable-output-escaping = "yes" | "no" />

The xsl:value-of element computes the string-value of an XPath expression and inserts it into the result tree. The string-values of the seven different kinds of nodes are as follows:

element

The text content of the element after all entity references are resolved and all tags, comments, and processing instructions are stripped

text

The text of the node

attribute

The normalized value of the attribute

root

The value of the root element

processing instruction

The processing instruction data (<?, ?>, and the target are not included)

comment

The text of the comment (<!-- and --> are not included)

namespace

The namespace URI

You can compute values of things that aren’t nodes. The value of a node-set is the value of the first node in the set. The value of a string expression is the string. The value of a number expression is the string form of the number. The value of a Boolean expression is the string true if the Boolean is true or the string false if the Boolean is false.

Attributes

select, required

This is the XPath expression whose value is inserted into the result tree.

disable-output-escaping, optional

If this attribute has the value yes, then when the output document is serialized, characters such as < and & in the value are not replaced with entity or character references. This may result in a malformed document.

Get XML in a Nutshell, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.