Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XPath functions in templates #128

Open
BillVelasquez opened this issue Aug 30, 2017 · 1 comment
Open

XPath functions in templates #128

BillVelasquez opened this issue Aug 30, 2017 · 1 comment
Labels

Comments

@BillVelasquez
Copy link

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(i­tems/price)}}

@Romanx
Copy link
Collaborator

Romanx commented Aug 31, 2017

That currently isn't something that is offered. You could implement something similar by creating a ValueGetterFactory and ValueGetter looking at XmlNodes and then compiling the expression and trying to run it. Hopefully this gives you the right direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants