Re: Order of processing templates
Karl Stubsjoen wrote: > How does one *best* control the flow/process by which templates are > followed? I assumed that it would be a top to bottom processing mechanism, > but it does not necessarily seem so. Processing starts at the root node of the source tree. The best matching template for that node is found and instantiated. The end. Any template might contain an xsl:apply-templates or xsl:for-each instruction that directs the processor to select more nodes for processing. In the case of xsl:apply-templates, the best matching template for each of those nodes is found and instantiated. In the case of xsl:for-each, the best matching template is considered to be in the content of the xsl:for-each element. So you control the processing order via the use of xsl:apply-templates and xsl:for-each instructions. The match attribute of a template merely declares that this template matches nodes of a certain pattern. There are built-in templates for each type of node, if you don't override them with your own. Mike -- Mike J. Brown | http://skew.org/~mike/resume/ Denver, CO, USA | http://skew.org/xml/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format