// 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";
}
OutputWrapper ow = new OutputWrapper();
ow.setEncoding (encoding);
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() );
context.put ("date", new java.util.Date() );
// only put this into the context if it exists.
if (projectDocument != null)
{
context.put ("project", projectDocument.getRootElement());
}
// Process the VSL template with the context and write out
// the result as the outFile.
writer = new BufferedWriter(new OutputStreamWriter(