XSL Match Templates
Style sheets are made of a number of templates, each of which defines what the XSLT processor should do when it matches a particular node in the XML source document. The XSLT processor populates the result document by instantiating a sequence of templates. Instantiation of a template means that the XSLT processor performs the following tasks:
- Copies any literal data from the template to the target
- Executes the XSLT instructions in the template
Templates are defined using the
<xsl: template> element. The match attribute in the <xsl:template> element indicates which parts of the source document should be processed with the particular template.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.
Root Match Templates in ePublisher
The root match template has a number of responsibilities in ePublisher:
- Recording files and dependencies
- Loading node sets
- Progress recording for the extension object that lives in the
wwprogressnamespace. - Up-to-date checking on the projects output files.
- Writing output
Last modified date: 01/28/2026