Subject: Re: [xsl] "Tunneling" a parameter in document order|
From: David Carlisle <davidc@xxxxxxxxx>
Date: Sat, 14 Apr 2012 15:48:01 +0100
Thanks David, this technique looks great and seems what I was looking for. It took me a little while to understand how and why the select="..." works, however :-)
Am I correct that by using the above, the maximum nesting depth of template calls is the number of (here:) elements in the source document? I tried with Saxon HE and got a "Too many nested apply-templates calls. The stylesheet may be looping." error after already 636 elements. I have to deal with documents eventually that have>100k elements.
Yes or if there are branches were you don't need this at all as you know in advance you don't need to pass information from one branch to another, so can use <xsl:apply-templates/> on the parent at those points. It all depends....
I'll have to look into ways of avoiding that error, like reducing the candidate elements and "skipping" the ones for which I know that they will not change the tunnel variable's value so that I do not recurse into a template for them.
reasonable documents will have more than around 600 list items in them, so that alone won't suffice.
Again, thanks for the great idea, and I now just need to work out the details...