// into the .xsb file.
// TODO: Can we just use the StylesheetRoot's list?
Vector compiledTemplates=new Vector();
// cache the typecast
StylesheetRoot root=(StylesheetRoot)getStylesheetRoot();
// For all templates used in this stylesheet (including
// those from imported and included stylesheets),
// compile to Java. (Takes advantage of the fact that
// ComposedStylesheet processing has already gathered
// these and reconciled conflicts.)
// New TemplateList being generated
org.apache.xalan.templates.TemplateList newTl
= new org.apache.xalan.templates.TemplateList();
// Iterate over contents of old TemplateList
org.apache.xalan.templates.TemplateList.TemplateWalker tw
=root.getTemplateListComposed().getWalker();
// Scan all templates in old list, compile, insert into new
ElemTemplate et;
while ( null != (et = tw.next()) )
{
ElemTemplate ct = compileTemplate(et);
// If compilation succeeds, use it; else fall back on interp
newTl.setTemplate( (ct!=null) ? ct : et);
}
// Postprocess/reconcile list
newTl.compose();
// And make it active
root.setTemplateListComposed(newTl);
// TODO: Theoretically, we can now discard imports/includes
// -- they're no longer pointing at the right ElemTemplates
// anyway. There's discussion of doing so in any case when
// they aren't needed for tooling support. Always do it here,