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>
               

            

Publishing & Printing

It is really hard to get things to look pretty, especially XML. That's why these publishing & printing companies use Stylus Studio to make a Mona Lisa out of data integration. Check out these top companies that are "stunning" with Stylus Studio!

DataDirect XML Converters

DataDirect XML Converters are high-performance Java components which provide bi-directional, programmatic access to virtually any data source as XML.

Retail Companies That Use Stylus Studio

Stores and XML data can get very crowded. That's why retail companies use Stylus Studio to simplify their data. With the power of Stylus Studio these top retail companies are at the front of the line when it comes to XML!

Generating Java Code with Stylus Studio

This is a video tutorial on how to generate Java Code with Stylus Studio

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member