skip to main content
Root Match Templates
Each XML document has a single root element. This element encloses all the following elements and is therefore the parent element to all the other elements. When the XSLT processor applies a style sheet to an XML document, it begins processing with the root element of the XML source document. To process the root element, the XSLT processor searches the style sheet for a template rule that matches the root element. A template rule matches the root element when the value of the template match attribute is / (slash).
If the user explicitly defines a template rule that matches the root element, the XSLT processor finds it and applies that template to the entire XML document. If the XSLT processor does not find an explicitly defined template rule that matches the root element, the processor implements the default template that matches the root element. Every style sheet includes this default template.
Was this helpful?
Last modified date: 11/30/2021