I am trying to use XmlTool to parse an XML file to be able to use the data in a Velocity template.
However, the documentation on it is all pretty poor and doesn't really give the information I need.
The documentation is at: https://velocity.apache.org/tools/devel/apidocs/org/apache/velocity/tools/generic/XmlTool.html
And I have tried:
VelocityContext context = new VelocityContext(page);
EasyFactoryConfiguration config = new EasyFactoryConfiguration();
config.toolbox("application")
.tool("org.apache.velocity.tools.generic.XmlTool")
.property("safeMode", false)
.property("key", "foo")
.property("file", xmlFilePath);
ToolboxFactory factory = config.createFactory();
template = Velocity.getTemplate(page.get("template-file"));
template.merge(context, write);
return write.toString();
But this is not working. How do I make the data actually make it's way to my template? I feel like I am missing so many steps, but just can't find the information I need!