antchfx / xpath

XPath package for Golang, supports HTML, XML, JSON document query.
MIT License
692 stars 88 forks source link

Implementing variables #66

Closed pgundlach closed 3 years ago

pgundlach commented 3 years ago

This is a very vague question, feel free to close it.

I'd like to add variables to expressions, so that queries such as xpath.Compile($a + 4) would work and evaluate to whatever is stored in $a + 4.

Do you have any suggestion where to add them? I assume that I need to pass some kind of context (with the defined variables) to Evaluate(). IMO these should be handled as part of the queries or in a similar structure. Perhaps you have a different suggestion where to add these?

zhengchun commented 3 years ago

It should be XSLT, not XPath.