Nustache
Nustache copied to clipboard
XPath functions in templates
This is a question, not an issue:
In Nustache you can use an XML document as the data for rendering, and then you can use XPath expressions that return nodes in the templates, like {{parent/child/node}}
Is it possible to use XPath functions in the templates?
It'll be really powerful to use something like {{sum(items/price)}}
That currently isn't something that is offered. You could implement something similar by creating a ValueGetterFactory
and ValueGetter
looking at XmlNode
s and then compiling the expression and trying to run it. Hopefully this gives you the right direction.