Subject: Re: [xsl] Second of two consecutive call-template instructions appears to affect the first? From: Sebastian Tennant <sebyte@xxxxxxxxxxxxxxx> Date: Wed, 15 Mar 2006 15:22:58 +0000 |
"Michael Kay" <mike@xxxxxxxxxxxx> wrote: > This template: > > <xsl:template name="does-image-flickr"> > <xsl:choose><!-- photo is a flickr link --> > <xsl:when test="/page/images/image[@name=$name]/flickr"> > <a href="{/page/images/image[@name=$name]/flickr}"> > <xsl:call-template name="pass-image-params" /> > > contains two refences to the variable $name, which isn't in scope in this > template. If you want it to be available in this template, you need to pass > it as a parameter. > > It looks as if Xalan isn't reporting this error if it occurs in a template > that isn't called. The XSLT 1.0 spec isn't very precise about which errors > are static errors and which are dynamic, so that's probably conformant: XSLT > 2.0 makes it mandatory to report this as a static error. > > Michael Kay > http://www.saxonica.com/ Well I'm stunned! I've explicitly declared all the variables at the start of all the templates and explicitly passed all the variables I want to pass in my template call-template calls resulting in about 20 extra lines of code... and it works! The reason I'm stunned is not because it works, but because I could have sworn it was working before. Nay, it _was_ working, I tested it, and it was workign _without_ all the explicit declarations and parameter passes. What's more, it seemed to make perfect sense; call-template preseves the local scope, apply-templates doesn't. Oh well, now I know it doesn't work like that, but I swear it almost did! Incredible! Thanks all. sdt
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Second of two consecutive, Sebastian Tennant | Thread | [xsl] XSLT 1.0: Problem grouping di, Nick Fitzsimons |
Re: [xsl] Second of two consecutive, Sebastian Tennant | Date | Re: [xsl] Second of two consecutive, Wendell Piez |
Month |