W3C home > Mailing lists > Public > public-xml-processing-model-wg@w3.org > February 2013

Re: Shadowing of options/variables

From: Henry S. Thompson <ht@inf.ed.ac.uk>
Date: Wed, 20 Feb 2013 17:01:19 +0000
To: "Toman\, Vojtech" <vojtech.toman@emc.com>
Cc: "public-xml-processing-model-wg\@w3.org" <public-xml-processing-model-wg@w3.org>
Message-ID: <f5br4kaq5r4.fsf@calexico.inf.ed.ac.uk>
Toman, Vojtech writes:

> I took a look at the spec and the test suite and what looks as
> potentially contradictory prose in the spec (section 2.9: "Variables
> and options share the same scope and may shadow each other." 
> vs. section 3.2: "That is, no option or variable may lexically
> shadow another option or variable with the same name.") is, I think,
> actually correct.
> . . .
> But you be able to do this:
>    <p:pipeline>
>      <p:option name="foo" select="..."/>
>      <p:group>
>        <p:variable name="foo" select="..."/>
>        ...
> The key point about section 3.2 is that it forbids declaring
> options/variables with the same name *in the same environment*, but
> not in different environments.

There's an ambiguity that was the source of my confusion, and that I'm
still concerned about:  the environment is a _data structure_, and the
environment of the p:group in the above example has a binding for
'foo' in it from the p:option.  So I thought the first quote above
would rule out the shadowing.

If OTOH you read 'environment' as naming a region of the XML tree,
rooted in the p:group element, then the problem doesn't arise. . .

       Henry S. Thompson, School of Informatics, University of Edinburgh
      10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131 650-4440
                Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk
                       URL: http://www.ltg.ed.ac.uk/~ht/
 [mail from me _always_ has a .sig like this -- mail without it is forged spam]
Received on Wednesday, 20 February 2013 17:01:49 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:32:51 UTC