Re: Variables/Parameters and Scoping

Hi Mohamed,

> On 5/26/06, *Jeni Tennison* <jeni@jenitennison.com 
> <mailto:jeni@jenitennison.com>> wrote:
> 
>     Doesn't:
> 
>        <p:variable name="validity" context="document"
>                    select="/*/@validity" />
>        <p:when test="$validity = 'partial' or $validity = 'none'">
>          ...
>        </p:when>
> 
>     provide just the same challenges for the implementation, in terms of
>     tracking dependencies through XPaths and keeping documents in
>     memory, as:
> 
>        <p:variable name="validity" select="$document/*/@validity" />
>        <p:when test="$validity = 'partial' or $validity = 'none'">
>          ...
>        </p:when>
> 
> As Richard pointed this out in last telcon, I'm in favor of the first 
> notation
> First, because the second is NOT a valid XPath 1.0 expression

Erm, are you saying that you don't think that "$document/*/@validity" is 
a valid XPath 1.0 expression? It *is* a valid XPath 1.0 expression; why 
do you think it isn't?

> Then, because we don't need to parse the full XPath to make a dependency 
> graph of the pipeline (for a wysiwig editor, for example)

I wonder if I'm misunderstanding what people mean when they say this. As 
far as I can tell, in both cases, you have to parse the XPath expression 
"$validity = 'partial' or $validity = 'none'" to tell that the condition 
is dependent on the 'document' input. Isn't that what people mean when 
they talk about dependency graphs?

> And last but not least because if we handle different kind of XPath in 
> the future (streamable, Xpath 2.0, etc.) it will not be necessary to 
> handle all those kinds of XPath

I don't understand the point you're making here. Could you expand?

Cheers,

Jeni
-- 
Jeni Tennison
http://www.jenitennison.com

Received on Friday, 26 May 2006 15:23:48 UTC