xsl:text

Adds a text node to the result tree.

Format

<xsl:text [disable-output-escaping="yes|no"]>
               

              
text_node_contents
                   

                
</xsl:text>

Description

The XSLT processor reports an error if instantiating text_node_contents results in anything other than characters.

You can also add text nodes to result documents by embedding the text in elements that you define.

You can specify the disable-output-escaping attribute of the xsl:text instruction. The allowed values are yes or no. The default is no. If the value is yes, the text node generated by instantiating the xsl:text element is output without any escaping. For example:

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

            

This instruction generates the single character <.

Examples

The following fragment adds two text nodes by embedding text.

<xsl:template match = "/">
               

              
<html>
                   
<head><title>Authors and Their Books</title></head>
                   
<body>
                   
<intro>Books in stock are listed here.</intro> 
                   
...
                   
</body>
                   
</html>
                   

                
</xsl:template>

The next example specifies the xsl:text instruction:

<xsl:text>Following is a list of authors.</xsl:text>
               

            

Learn Convert to XML

Convert to XML lets you convert .txt, binary, and EDI files to XML documents. Convert to XML works on a single document, or to build reusable converters that let you open flat files as XML documents. Free online demonstration!

XML Notepad

XML Notepad simplifies building of XML applications, allowing authors to rapidly build and edit their XML files. With XML Notepad, you can create XML document prototypes quickly, easily, using an intuitive graphical interface.

XML-DEV Blog

Join the XML Development discussion at XML-Dev - the hottest place to talk about XML technologies, trends, systems architecture and all the latest buzz. Bookmark this RSS and ATOM feed now!

XQuery Mapper

Stylus Studio has the industry's only XQuery mapper, enabling you to develop sophisticated XML mappings consisting of queries and data transformation in an intuitive, visual manner.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member