|
Home >Online Product Documentation >Table of Contents >What Is a Template? What Is a Template?A template defines what the XSLT processor should do when it processes 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 The following topics further describe what a template is: Contents of a Template
The stylesheet example in Example of a Stylesheet defines the following templates using the
In the The template body defines actions you want the XSLT processor to perform each time it instantiates this template. It contains Determining Which Template to Instantiate
When the XSLT processor applies a stylesheet to an XML document, it begins processing with the root node of the XML source document. To process the root node, the XSLT processor searches the stylesheet for a template rule that matches the root node. A template rule matches the root node when the value of the template's If you explicitly defined a template rule that matches the root node, the XSLT processor finds it and instantiates its template. If the XSLT processor does not find an explicitly defined template rule that matches the root node, the processor instantiates the default template that matches the root node. Every stylesheet includes this default template.
In the sample stylesheet on , the template rule in the first template matches the root node: The XSLT processor instantiates this template to start generating the result document. It copies the first few lines from the template to the result document. Then the XSLT processor reaches the following XSLT instruction:
When the XSLT processor reaches the
After instantiating this template for the first
After three instantiations of the How the select and match Attributes Are DifferentConsider the following instructions:
The
When the XSLT processor reaches an expression that is the value of a
When the XSLT processor reaches a pattern that is the value of a For example, suppose you have the following instruction:
This instruction selects the This example shows that the expression that the XSLT processor uses to select nodes and the pattern it uses to match nodes are independent of each other. |
HTML to XML Importer
Convert HTML to XML with the Stylus Studio HTML to XML Importer, a powerful, visual utility for Converting HTML to XML with ease.
XML Development Blogs
Blogging is the hottest fad on the Internet and Stylus Studio has jumped on the bandwagon. Bookmark these XML Blogs to keep up with all the latest XML buzz in the internet blogosphere. Includes RSS and Atom Feeds!
Building Workflow Applications with XML
Learn how to design custom XML workflow applications - from modeling your data and information processes, to capturing input from users in XML, and finally, generating useful queries and reports from the XML data -- using XSLT & XQuery technologies.
XSL:FO Editor
The XSL-FO editor provides syntax help, code completion integrated PDF preview, and integration with industry-leading XSL-FO processors including RenderX XEP and Apache FOP. Simplify XSL FO development with Stylus Studio.


