On Thu, 19 Sep 2002, Mark Hortman wrote:

> We are doing development using Jaxen, and while we find it fast, I had some
> thoughts that I would like to share.
> We do a lot of construction of dynamic xpath statements, and a colleague and
> I got to thinking how cool it would be if jaxen supportd a JDBC like
> PreparedStatement concept. This would allow me to say
> 
> XPath xpath = new XPath("//girls/molecules[@id=?]");
> xpath.setString(1,"ChemicalX");
> 
> We want this because the call to XPath constructor seems to be very
> expensive.
> 
> Any thoughts on this feature?

Yah, check out VariableContext.

  XPath xpath = new XPath("//girls/molecules[@id=$id]");

Then, you just have to give it a VariableContext to resolve $id against.
This is part of the XPath specification.

        -bob



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Jaxen-interest mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jaxen-interest

Reply via email to