[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: XSLT Processing Model Questions

Subject: RE: XSLT Processing Model Questions
From: "Dietrich Ayala" <dietrich@xxxxxxxxx>
Date: Sat, 13 Apr 2002 17:12:54 -0700
model questions
Thanks Peter, your explanation was quite helpful. I have a couple more questions:

> The reason it works is because there is a different between *match*
> expressions and *select* expressions.  In match expressions (template
> match="..."), the context node does not affect the result.  Here,
> match="doc/title" simply means to match <title> elements that are immediate
> children of a <doc> element, regardless of what the current context is.  Once
> the <title> is matched, the <title> becomes the context node within the
> template; the "doc/" is only a restriction on which <title>s can be matched.
>
> Think of match expressions as going in reverse.  Here are the basic steps:
>
> * apply-templates selects a <title> node (as a child of the context node).
> * The template tries to match "title" to the selected node.  So far so good.
> * The template looks to see if the <title> also has a <doc> parent.  So far so
> good.
> * Everything has matched successfully, so the template executes with the
> <title> as the context node.

My next question is: What precurses the above steps? The processor retrieves all <title> children of the root node, and then goes
through the steps above?

>
> On the other hand, in expressions like in
> <xsl:apply-templates select="child::node()"/> (the equivilant of what you
> have), are relative to the context node, as you know.  But this only selects
> the nodes; the act of matching them to a template is a totally different
> process (read the XPath spec; these two types of expressions even have
> different grammars, although they are very similar).

So, given the example:

<xsl:apply-templates select="child::node()"/>

The processor would:

* take the nodeset returned from evaluating "child::node()" against the source tree context node
* follow the steps in 5.4 (applying template rules) and 5.5 (conflict resolution for template rules) to determine which is the best
template
* apply the chosen template to the nodeset?

Thanks,

Dietrich


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.