commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitri Plotnikov <>
Subject Re: [JXPath] Use of contexts/variables
Date Sat, 22 Feb 2003 17:52:41 GMT

This is an easy one.  In JXPath Variables is an interface - you are
free to provide your own implementation and install it on JXPathContext
by calling context.setVariables().  It is a very simple interface and
you won't have any trouble meeting your requirement.

I hope this helps.

- Dmitri

--- Steve Pannier <> wrote:
> Dmitri,
> Here's a new question for you.
> Our product allows the user to include any number of
> "variables" in their xpath expression.  These are not
> xpath variables, but rather variables they define in our
> design time framework.  The user is free to define the
> type for each variable, and they can define structure
> types.  Each variable's data is contained in a Map
> hidden in a subclass of the variable.  Now, when they
> provide an xpath expression, we allow them to include
> any number of these variables they choose to.  So, in
> order to allow us to evaluate these expressions without
> having to first parse the expression, we decided to create
> a root context of NULL, and then add each variable's
> data map to the context as an xpath variable.  The result
> of this is, if the user has a variable named "Var1", they
> must reference it in their expression as "$Var1/Var1".
> We would rather the user not have to use this syntax in
> expressions for referencing variables.  We are talking
> about allowing them to simply use "$Var1" in their
> expression.  Then before evaluating the expression we
> would substitute the "$Var1" with "$Var1/Var1".  This
> would require us to either write our own pre-parser, or
> somehow make use of JXPath code to do this.  But, I'm
> curious if there's any other way to attack this.  Maybe
> by defining the context differently.  Any ideas?
> Let me know if the above explanation of what we're
> trying to do is not clear.
> Steve Pannier
> Jacada, Inc.
> (763) 201-0002 Ext. 219
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more

View raw message