Subject: Re: [xsl] Identity Transform and Default Templates, I think... From: Mike Brown <mike@xxxxxxxx> Date: Tue, 18 Jun 2002 16:24:30 -0600 (MDT) |
Schneeman, Brent wrote: > I think that my question boils down to template application - when does a > particular template get applied? When does the default template get applied? Source XML document is parsed by an XML parser, its logical contents reported to the XSLT processor, and the processor models the info as a tree of nodes according to the XPath/XSLT data model. (It's a very DOM-like model if you're familiar with that). The topmost node (always present) is the root node. The XML source's "document element" (top/outermost element) is the only child of the root node. From there, the hierarchy depends on the content of the document. Processing begins at the root node, always. The best matching template for that node is found and its contents instantiated. End of processing. xsl:apply-templates and xsl:for-each instructions typically select new nodes for processing. Each node selected is processed in turn, using the best matching template for that node. Order of processing can be influenced by the type of the current node, the XPath axis used in the selection expression (ancestor:: for example defaults to reverse document order), and the xsl:sort instruction. The built-in template for the root node and any element node has an xsl:apply-templates instruction that selects all the children of the current node. Hence, recursive descension of the source tree occurs by default (but not into attribute nodes or namespace nodes). The built-in template for a text node copies the node to the result tree. - Mike ____________________________________________________________________________ mike j. brown | xml/xslt: http://skew.org/xml/ denver/boulder, colorado, usa | resume: http://skew.org/~mike/resume/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Identity Transform and De, David Carlisle | Thread | RE: [xsl] Identity Transform and De, Andrew Welch |
Re: [xsl] CDATA question, Mike Brown | Date | [xsl] Hello World, Ingo Weiss |
Month |