/** * initializes the document. init() is not longer dependant upon context, but we need to let the * init() carry the template name down throught for VM namespace features */ public void initDocument() throws Exception { /* * send an empty InternalContextAdapter down into the AST to initialize it */ InternalContextAdapterImpl ica = new InternalContextAdapterImpl(new VelocityContext()); try { /* * put the current template name on the stack */ ica.pushCurrentTemplateName(name); /* * init the AST */ ((SimpleNode) data).init(ica, rsvc); } finally { /* * in case something blows up... * pull it off for completeness */ ica.popCurrentTemplateName(); } }