private static boolean m_init = false;
private DocumentRoot load(String filename) throws IOException
{
if (!m_init) {
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("xml", new ConfigResourceFactoryImpl());
ConfigPackageImpl.init();
ConfigFactoryImpl.init();
m_init = true;
}
ConfigResourceImpl resource = (ConfigResourceImpl)(new ConfigResourceFactoryImpl()).createResource(URI.createURI("file://" + filename));
resource.load(null);
DocumentRoot documentRoot = (DocumentRoot)resource.getContents().get(0);
return documentRoot;
}