W3C home > Mailing lists > Public > www-dom-xpath@w3.org > May 2000

RE: [dom-xpath] Competing Proposals Proposal

From: <jeroen@tcf.nl>
Date: Fri, 12 May 2000 23:28:00 +0200 (CEST)
Message-Id: <200005122128.XAA05458@webmail2.xs4all.nl>
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 GMT

This archive was generated by hypermail 2.2.0 + w3c-0.30 : Friday, 25 March 2005 11:19:25 GMT