Re: [xsl] How many passes through the document

Subject: Re: [xsl] How many passes through the document
From: Andrew Welch <andrew.j.welch@xxxxxxxxx>
Date: Sat, 22 Sep 2012 18:03:11 +0100
On 22 September 2012 11:50, Ihe Onwuka <ihe.onwuka@xxxxxxxxxxxxxx> wrote:
> Will the stylesheet below result in 2 passes through the document. I
> the normal recursive descent parsing and 2 to evaluate the global
> variable?

Assuming the variable gets evaluated, then:

>    <xsl:variable name="all">
>       <xsl:apply-templates select="*"/>

...will construct a node list containing just the root element of the
primary input document node, and then "push" it at the templates in
the stylesheet:

>    <xsl:template match="*">
>       stuff

this template will be matched, and all it does is add a text node to
the result... so the processing started by the variable stops there.


-- 
Andrew Welch
http://andrewjwelch.com

Current Thread