liflab / xml-lif

Simple XML parsing and XPath library in Java
GNU Lesser General Public License v3.0
1 stars 0 forks source link

Allow an XPath expression to contain a placeholder #1

Open sylvainhalle opened 8 years ago

sylvainhalle commented 8 years ago

...such as /blah[foo=$x]. Here $x is a placeholder. When evaluating an expression on a document, one could pass an (optional) argument (a Map<String,Object>), and occurrences of placeholders could be dynamically replaced by what the map says.

This would help in BeepBeep 3, where currently occurrences of variables are evaluated by performing a string replacement, and then parsing the resulting string into an XPath expression, every time.

sylvainhalle commented 6 years ago

BeepBeep currently supports this, but in an inelegant way (find/replace on the query string before it is parsed).