xsl:value-of Element

Inserts the value of the selected node as text.

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

Attributes

  • select
    [required] Expression to be evaluated against the current context. The results are converted to a string as by a call to the string function. A node-set is converted to a string by inserting the string value of the first node in the set.

  • disable-output-escaping
    Default is "no". If the value is "yes", a text node generated by instantiating the <xsl:text> element will be output without any escaping. For example, the following generates the single character "<".

    <xsl:text disable-output-escaping="yes">&lt;</xsl:text> 
    

    Note   disable-output-escaping="yes" can be used to generate non-well-formed documents, and thus should be used with caution, because non-well-formed output may generate errors in certain circumstances. For example, transformNodeToObject to an XML document requires that the result be well-formed and thus may not complete if disable-output-escaping has affected the well-formed appearance of the document. Consider disable-output-escaping="yes" an advanced feature to be used only when the potential dangers are understood.

Element Information

Number of occurrences Unlimited
Parent elements xsl:attribute, xsl:comment, xsl:copy, xsl:element, xsl:for-each, xsl:if, xsl:otherwise, xsl:param, xsl:processing-instruction, xsl:template, xsl:variable, xsl:when, xsl:with-param, output elements
Child elements (No child elements)

Remarks

The <xsl:value-of> element inserts a text string representing the value of the first element (in document order) specified by the select attribute.

If the XML Path Language (XPath) expression returns more than a single node, the <xsl:value-of> element returns the text of the first node returned (equivalent to the XMLDOMNode object's selectSingleNode method). If the node returned is an element with substructure, <xsl:value-of> returns the concatenated text nodes of that element's subtree with the markup removed.

See Also

XSLT Elements | Creating and Populating an HTML Template

 Last updated on Saturday, April 10, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.