The source for the org.jaxen.expr.DefaultPathExpr.evaluate() method is:

     public Object evaluate(Context context) throws JaxenException
     {
         Object results = getFilterExpr().evaluate( context );

         context.setNodeSet( convertToList( results ) );

         return getLocationPath().evaluate( context );
     }

It seems to me that invoking the setNodeSet() method on the Context 
instance that was passed as an argument is incorrect. Shouldn't a new 
Context be created for evaluation of the location path? For example:

     public Object evaluate(Context context) throws JaxenException
     {
         Object results = getFilterExpr().evaluate( context );

         Context pathContext = new Context( context.getContextSupport() );
         pathContext.setNodeSet( convertToList( results ) );

         return getLocationPath().evaluate( pathContext );
     }

Otherwise, evaluating the LHS of a UnionExpr (e.g.) could change the 
context for evaluation of the RHS. Comments, anyone?

Thanks,


Ari Kermaier    [EMAIL PROTECTED]
Senior Software Engineer
Phaos Technology Corp.    http://www.phaos.com/



-------------------------------------------------------
This sf.net email is sponsored by: Dice - The leading online job board
for high-tech professionals. Search and apply for tech jobs today!
http://seeker.dice.com/seeker.epl?rel_code=31
_______________________________________________
Jaxen-interest mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jaxen-interest

Reply via email to