W3C home > Mailing lists > Public > xproc-dev@w3.org > November 2011

RE: Shadowing of variables..

From: <vojtech.toman@emc.com>
Date: Mon, 28 Nov 2011 03:03:41 -0500
To: <xproc-dev@w3.org>
Message-ID: <3799D0FD120AD940B731A37E36DAF3FE33FBDB8F65@MX20A.corp.emc.com>
Geert,

Good catch, I think you have found a bug in the specification. In the section 5.7 (Variables, Options, and Parameters), the specification indeed says:

"Variables are created in compound steps and, like XSLT variables, are single assignment, though they may be shadowed by subsequent declarations of other variables with the same name."

But in section 3.2 (Scoping of names) it also says that:

"It is a static error (err:XS0004) if an option or variable declaration duplicates the name of any other option or variable in the same environment. That is, no option or variable may lexically shadow another option or variable with the same name."

These two statements clearly contradict each other. I think the fix is to remove the mention of shadowing from 5.7, but the WG will need to discuss this.

Regards,
Vojtech

--
Vojtech Toman
Consultant Software Engineer
EMC | Information Intelligence Group
vojtech.toman@emc.com
http://developer.emc.com/xmltech

> -----Original Message-----
> From: Geert Josten [mailto:geert.josten@dayon.nl]
> Sent: Sunday, November 27, 2011 1:59 PM
> To: XProc Dev
> Subject: Shadowing of variables..
> 
> The recommendation says:
> 	"Variables are created in compound steps and, like XSLT
> variables,
> are single assignment, though they may be shadowed by subsequent
> declarations of other variables with the same name."
> 	(http://www.w3.org/TR/xproc/#variables-options-parameters)
> 
> But doing this is not accepted by XMLCalabash:
> 
> 	<p:variable name="myvar" select="1"/>
> 	<p:variable name="myvar" select="2"/>
> 
> Nor is:
> 
> 	<p:variable name="myvar" select="1"/>
> 	<p:group>
> 		<p:variable name="myvar" select="2"/>
> 
> Is XMLCalabash too strict here or should I read 'subsequent
> declarations'
> in a different way?
> 
> Kind regards,
> Geert
> 
> 
> drs. G.P.H. (Geert) Josten
> Senior Developer
> 
> 
> 
> Dayon B.V.
> Delftechpark 37b
> 2628 XJ Delft
> 
> T +31 (0)88 26 82 570
> 
> geert.josten@dayon.nl
> www.dayon.nl
> 
> De informatie - verzonden in of met dit e-mailbericht - is afkomstig
> van
> Dayon BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit
> bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen.
> Aan
> dit bericht kunnen geen rechten worden ontleend.
> 
Received on Monday, 28 November 2011 08:04:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 28 November 2011 08:04:22 GMT