Re: [xsl] import href vaule set using Xpath

Subject: Re: [xsl] import href vaule set using Xpath
From: Mike Brown <mike@xxxxxxxx>
Date: Mon, 25 Feb 2002 21:05:32 -0700 (MST)
> Where can we get such information about XSLT internal process...
> 
> I mean..
> Internally how stylesheet  is getting processed..
> What is the first step
> Then what is the next step..etc..
> The actual internal flow..
> 
> On-line would be helpful.

Section 5 of the XSLT 1.0 specification at http://www.w3.org/TR/xslt
explains it.

Here is my own explanation for you:

The source document is interpreted as a DOM-like tree of nodes as prescribed 
by the XPath data model. (See the XPath spec at http://www.w3.org/TR/xpath )

The XSLT processor begins processing at the root node of the source tree. It
looks in the stylesheet for a template that is a good match for that node.

The best matching template for the node currently being processed is
instantiated with a context consisting of a current node (the node being
processed; you can refer to it as '.' in XPath expressions in the template), a
current node list (all nodes, including the current one, that have been
selected for processing; initially this is still just the root node; this list
affects how certain XPath functions behave), and a few other bits of
information.

In each template are instructions that say how to go about creating a new tree
of nodes called the result tree. These instructions may exist in the form of
XSLT instructions in the XSLT namespace (traditionally denoted by the 'xsl:'
prefix, although this is not required), or in the form of literal elements in
any other namespace.

There are a couple of XSLT instructions that are special: xsl:apply-templates
and xsl:for-each ... these both do pretty much the same thing. They select a
new set of nodes for processing. Those nodes are then processed in a certain
order (which you can change with xsl:sort), one by one.  In the case of
apply-templates, the best matching template for each node is located and its
contents instantiated. In the case of for-each, the content of the for-each is
instantiated for each node, rather than any other templates.

There are a few built-in templates described in section 5.8 of the XSLT
specification (go look at them so you can see what they do). Unless you
override them with your own templates, they will cause most of the source tree
to be processed recursively, with the only things added to the result tree
being copies of the text nodes from the source tree.

When processing is done, the result tree may be automatically serialized (as
bytes, usually) according to XML syntax, HTML syntax, or plain text by the
XSLT processor. The processor might use your xsl:output instruction to find
out what kind of serialization you prefer.

   - Mike
____________________________________________________________________________
  mike j. brown, fourthought.com  |  xml/xslt: http://skew.org/xml/
  denver/boulder, colorado, usa   |  personal: http://hyperreal.org/~mike/

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


Current Thread