XSLT <xsl:text> Element
Complete XSLT Element Reference
Definition and Usage
The <xsl:text> element is used to write literal text to the output.
Tip: This element may contain literal text, entity references, and #PCDATA.
Syntax
<xsl:text
disable-output-escaping="yes|no">
<!-- Content:#PCDATA -->
</xsl:text>
|
Attributes
| Attribute |
Value |
Description |
| disable-output-escaping |
yes no |
Optional. "yes" indicates that special characters (like
"<") should be output as is. "no" indicates that special characters (like
"<") should be output as "<". Default is "no". This
attribute is not supported by Netscape 6 |
Example 1
Displays the title of each CD. Inserts a ", " between each cd-title if it is
not the last CD - or the last but one. If it is the last CD, it will add a "!" behind the
title. If it is the last but one, add a ", and " behind the title:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>My CD Collection</h2>
<p>Titles:
<xsl:for-each select="catalog/cd">
<xsl:value-of select="title"/>
<xsl:if test="position() < last()-1">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:if test="position()=last()-1">
<xsl:text>, and </xsl:text>
</xsl:if>
<xsl:if test="position()=last()">
<xsl:text>!</xsl:text>
</xsl:if>
</xsl:for-each>
</p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
|
Complete XSLT Element Reference
The Altova MissionKit is a suite of intelligent XML tools, including:
XMLSpy® – industry-leading XML editor
- Support for all XML-based technologies
- Graphical editing views, powerful debuggers, code generation, & more
MapForce® – graphical data mapping tool
- Drag-and-drop data conversion with code generation
- Support for XML, DBs, EDI, Excel® 2007, text, Web services
StyleVision® – visual stylesheet designer
- Drag-and-drop stylesheet design for XML & databases
- Output to HTML, PDF, RTF, Word 2007, & more
And more…
Try before you buy with a free fully functional 30-day trial
Download today
 |
|
Get Your Diploma!
W3Schools' Online Certification Program is the perfect solution for busy
professionals who need to balance work, family, and career building.
The HTML Certificate is for developers who want to document their knowledge of HTML, XHTML, and CSS.
The JavaScript Certificate is for developers who want to document their knowledge of JavaScript and the HTML DOM.
The ASP Certificate is for developers who want to document their knowledge of ASP, SQL, and ADO.
|
|