Re: Parameters and options

-----BEGIN PGP SIGNED MESSAGE-----
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
 environment."

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.

ht

[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]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFGI6IXkjnJixAXWBoRAhZwAJ4+GBUaaNLUT4j8owkja2NBv3L4EACfS+7S
AV4IEQQGAAj/65IHwxWD1L0=
=Z6lf
-----END PGP SIGNATURE-----

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