XML technologies / XSLT / Introduction to XSLT 2.0 / Getting started with XSLT and XPath / Structure controls processing / Default rules for comment and PI nodes

(Excerpt from "XSLT 2.0 & XPath 2.0" by Frank Bongers, Chapter 1.)

The default behavior for comment and processing-instruction nodes is to do nothing. This can be expressed by a single empty default template rule:

<xsl:template match="comment()|processing-instruction()"/>

These are also two separate rules: if an explicit rule is added to the stylesheet for only one of the two node types, the default behavior for the other node type remains unchanged.

   

back to top