Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
The November 1999 XSL Transformations (XSLT) Recommendation includes two built-in templates, which are included in the Microsoft® XSLT processor. These templates make it easier to create style sheets for irregular data by passing text from the source document to the output automatically.
The built-in template included in the Microsoft XSLT processor for element nodes and the root node looks like the following code example.
Copy Code | |
---|---|
<xsl:template match="/|*"><xsl:apply-templates/></xsl:template> |
The built-in template for text and attribute nodes is as shown in the following code example.
Copy Code | |
---|---|
<xsl:template match="text()"><xsl:value-of select="."/></xsl:template> |
The built-in template for processing instructions and comments is to take no action, as shown in the following code example.
Copy Code | |
---|---|
<xsl:template match="processing-instruction()|comment()"/> |
On their own, these templates provide for a complete, though simple, transformation of the source document. Elements and the document root are traversed, although they do not generate any output themselves. The values of text nodes and CDATA sections are passed through. Comments and processing instructions are not processed and thus do not appear in the output. The end result is that these templates by themselves strip all markup from the source document but preserve the text.
To override these built-in templates, specify your own templates in the style sheet so that every node is handled.