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

Re: Parameters and options

From: Henry S. Thompson <ht@inf.ed.ac.uk>
Date: Mon, 16 Apr 2007 17:19:35 +0100
To: Norman Walsh <Norman.Walsh@Sun.COM>
Cc: public-xml-processing-model-wg@w3.org
Message-ID: <f5bvefwi960.fsf@hildegard.inf.ed.ac.uk>

Hash: SHA1

Norman Walsh writes:

>   <px:debug>
>     <p:parameter name="elemcountplus1" select="$elemcount+1"/>
>     <p:parameter name="elemcount" select="count(//*)">
>       <p:pipe step="loader" port="result"/>
>     </p:parameter>
>   </px:debug>
> And it's up to implementations to make sure that parameters get
> evaluated in the right order and that there are no circular
> dependencies. (In this case, elemcount=1 and elemcountplus1=2.)

Not at all.  There is previous mail about this (previous thread starts
[1]).  In that thread I proposed the unordered, step-scoped parameter
binding approach:

 "The environment which the p:import-parameter should use clearly does
 _not_ create a loop, and the XPath should be seeing the same

and you agreed.

So the above is broken, because there is no binding for 'elemcount' in
the environment inherited by the px:debug step.  Also, there is no
requirement to order.  Remember another reason why -- requiring
implementations to figure out the right ordering means requiring them
to parse the xpaths themselves to look for variable references,
i.e. they cannot use an off-the-shelf XPath library.

> I assume that options and parameters are in entirely different
> namespaces, so:
>   <px:debug>
>     <p:parameter name="opt1" value="3"/>
>     <p:parameter name="opt2" select="$opt1+1"/>
>     <p:option name="opt1" value="5"/>
>     <p:option name="opt2" value="$opt1+1"/>
>   </px:debug>
> Means the px:debug component gets two parameters, opt1 and opt2, with
> the values 3 and 4, respectively, and two options, opt1 and opt2, with
> the values 5 and 6, respectively.
> Right?

Wrong, for the reason given above.

Also, in that thread, and in the spec., we agreed that _only_
parameters are available for $ reference, so even if the above were
allowed, it would mean that option opt2 has value 4.


[1] http://lists.w3.org/Archives/Public/public-xml-processing-model-wg/2007Apr/0008.html
- -- 
 Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
                     Half-time member of W3C Team
    2 Buccleuch Place, Edinburgh EH8 9LW, 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 really from me _always_ has this .sig -- mail without it is forged spam]
Version: GnuPG v1.2.6 (GNU/Linux)

Received on Monday, 16 April 2007 16:20:29 UTC

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