//-- command line status
log("Input: " + xmlFile, Project.MSG_INFO );
// Build the JDOM Document
Document root = builder.build(inFile);
// Shove things into the Context
VelocityContext context = new VelocityContext();
/*
* get the property TEMPLATE_ENCODING
* we know it's a string...
*/
String encoding = (String) ve.getProperty( RuntimeConstants.OUTPUT_ENCODING );
if (encoding == null || encoding.length() == 0
|| encoding.equals("8859-1") || encoding.equals("8859_1"))
{
encoding = "ISO-8859-1";
}
Format f = Format.getRawFormat();
f.setEncoding(encoding);
OutputWrapper ow = new OutputWrapper(f);
context.put ("root", root.getRootElement());
context.put ("xmlout", ow );
context.put ("relativePath", getRelativePath(xmlFile));
context.put ("treeWalk", new TreeWalker());
context.put ("xpath", new XPathTool() );
context.put ("escape", new Escape() );