2nd attempt - it bounced...

On 12/14/01 10:07 AM, "James Strachan" <[EMAIL PROTECTED]> wrote:

> I'm just thinking about some common cases like this...
> 
>   * | @* | text()
> 
> Rather than building up an expression tree something like this... (in
> pseudo-code)
> 
>   UnionExpr
>       LocationPath
>           PredicateExpr( is element )
>       LocationPath
>           PredicateExpr( is attribute )
>       LocationPath
>           PredicateExpr( is text )
> 
> Where 3 seperate location path expressions are evaluated, we just hack the
> expression simplify() methods so that UnionExpr tries to simplify & refactor
> itself to something like this...
> 
>       LocationPath
>           UnionPredicate
>               PredicateExpr( is element )
>               PredicateExpr( is attribute )
>               PredicateExpr( is text )
> 

This was my target mental model, being able to test all expressions in the
same pass, but I don't understand how jaxen works yet nor do I have the
vocabulary to even ask the right questions :)  I feel like I am just waving
my hands and grunting :)

> i.e. so that if the start of the location path is the same, as in the above
> example, we just navigate once and union together the predicates.
> 
> Sure this only solves the problem for similar location paths, like
> 
>   foo/a | foo/b
> 

I would think that you would want to break that constraint, that they have
to be similar, as the starting context is the same for all parts of the
union?  Are the matches that expensive?

> but I would think it will solve Geir's problem for sure.

I've put aside the need for this feature at the moment so don't worry there.
I can add it later when all is well.

>It would be a
> fairly simple refactoring of the expression tree as well - and be more
> optimal as it'd avoid unnecessary tree traversal..

I volunteer if you want, but I will need some support to get started.  The
Javadocs are a bit sparse in places :)

Lets see if this message bounces :)

-- 
Geir Magnusson Jr.                                     [EMAIL PROTECTED]
System and Software Consulting
"They that can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety." - Benjamin Franklin




Attachment: delivery-status document)
Description: Binary data

--- Begin Message ---
On 12/14/01 10:07 AM, "James Strachan" <[EMAIL PROTECTED]> wrote:

> I'm just thinking about some common cases like this...
> 
>   * | @* | text()
> 
> Rather than building up an expression tree something like this... (in
> pseudo-code)
> 
>   UnionExpr
>       LocationPath
>           PredicateExpr( is element )
>       LocationPath
>           PredicateExpr( is attribute )
>       LocationPath
>           PredicateExpr( is text )
> 
> Where 3 seperate location path expressions are evaluated, we just hack the
> expression simplify() methods so that UnionExpr tries to simplify & refactor
> itself to something like this...
> 
>       LocationPath
>           UnionPredicate
>               PredicateExpr( is element )
>               PredicateExpr( is attribute )
>               PredicateExpr( is text )
> 

This was my target mental model, being able to test all expressions in the
same pass, but I don't understand how jaxen works yet nor do I have the
vocabulary to even ask the right questions :)  I feel like I am just waving
my hands and grunting :)

> i.e. so that if the start of the location path is the same, as in the above
> example, we just navigate once and union together the predicates.
> 
> Sure this only solves the problem for similar location paths, like
> 
>   foo/a | foo/b
> 

I would think that you would want to break that constraint, that they have
to be similar, as the starting context is the same for all parts of the
union?  Are the matches that expensive?

> but I would think it will solve Geir's problem for sure.

I've put aside the need for this feature at the moment so don't worry there.
I can add it later when all is well.

>It would be a
> fairly simple refactoring of the expression tree as well - and be more
> optimal as it'd avoid unnecessary tree traversal..

I volunteer if you want, but I will need some support to get started.  The
Javadocs are a bit sparse in places :)

Lets see if this message bounces :)

-- 
Geir Magnusson Jr.                                     [EMAIL PROTECTED]
System and Software Consulting
"They that can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety." - Benjamin Franklin



--- End Message ---

Reply via email to