An XSLT looks at an XML document as a collection of nodes of the following types:
An XSLT document contains one or more templates, which are created with the
<xsl:template /> tag. When an XML document is transformed with an XSLT, the XSLT processor reads through the XML document starting at the root, which is one level above the document element, and progressing from top to bottom, just as a person would read the document. Each time the processor encounters a node, it looks for a matching template in the XSLT.
If it finds a matching template, it applies it; otherwise, it uses a default template as defined by the XSLT specification. The default templates are shown in the table below.
|Node Type||Default Template|
|Root||Apply templates for child nodes.|
|Element||Apply templates for child nodes.|
|Attribute||Output attribute value.|
|Text||Output text value.|
|Processing Instruction||Do nothing.|
In this context, attributes are not considered children of the elements that contain them, so attributes get ignored by the XSLT processor unless they are explicitly referenced by the XSLT document.