- From: <jeroen@tcf.nl>
- Date: Fri, 12 May 2000 23:28:00 +0200 (CEST)
- To: www-dom-xpath@w3.org
scott wrote:
> To be clear, here's how it would look:
> ExpressionFactory efactory = ExpressionFactory.newInstance("Xpath");
> Expression expr = efactory.create("foo/baz[greeting=$foo]",
> myPrefixResolver);
> myXEnvironment.pushVariable("foo", "hello");
> XObject val1 = expr.evaluate(myNode, myXEnvironment);
> myXEnvironment.popVariable();
> myXEnvironment.pushVariable("foo", "goodby");
> XObject val2 = expr.evaluate(myNode, myXEnvironment);
> myXEnvironment.popVariable();
I don't like the idea of the stack behind the variable list.
Why not a simple addVariable("what", "this"), removeVariable("what") ?
You might considering a variable interface to make the interface more extendable
Which would mean:
XPathExpression expr = PAXFactory.createXPathExpression("foo/baz");
PaxVariableList variables = expr.getVariableList();
variables.addVariable( new Variable("a","b") );
XPathResultSet results = expr.evaluate(myNode);
Jeroen
--------------------------------
Jeroen van Rotterdam
The Connection Factory
http://www.xhive.com
--------------------------------
Received on Friday, 12 May 2000 17:28:04 UTC