Generates a processing instruction in the output.
<xsl:processing-instruction name = "pi-name"> </xsl: processing-instruction>
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 | xsl:apply-templates, xsl:choose, xsl:copy, xsl:copy-of, xsl:for-each, xsl:if, xsl:text, xsl:value-of, xsl:variable, output elements |
The <xsl:processing-instruction> element generates a processing instruction (PI) in the output. The name is indicated by the name attribute. The content of the element provides the rest of the PI.
This example shows a template that generates the XML declaration and a style sheet processing instruction in the output.
<xsl:template match="/"> <xsl:text disable-output-escaping="yes"><?xml version="1.0"?></xsl:text> <xsl:apply-templates /> </xsl:template>
Generating More Sophisticated Output