try {
if(getUseDTD()){
// Load elements from DTD
String systemID = comboSystemID.getText();
comboDocumentRoot.removeAll();
DTDResolver resolver = new DTDResolver(new IDTDResolver[0],
page1.getFile().getLocation().makeAbsolute().toFile().getParentFile());
InputStream in = resolver.getInputStream(systemID);
// if(in==null){
// URL url = new URL(systemID);
// in = url.openStream();
// }
if(in!=null){
Reader reader = new InputStreamReader(in);
DTDParser parser = new DTDParser(reader);
DTD dtd = parser.parse();
Object[] obj = dtd.getItems();
for(int i=0;i<obj.length;i++){
if(obj[i] instanceof DTDElement){
DTDElement element = (DTDElement)obj[i];
String name = element.getName();
comboDocumentRoot.add(name);
}
}
comboDocumentRoot.select(0);
}
}
if(getUseXSD()){
// Load elements from XML Schema
comboDocumentRoot.removeAll();
DTDResolver resolver = new DTDResolver(new IDTDResolver[0],
page1.getFile().getLocation().makeAbsolute().toFile().getParentFile());
InputStream in = resolver.getInputStream(getSchemaURI());
if(in!=null){
SchemaGrammar grammer = (SchemaGrammar)new XMLSchemaLoader().loadGrammar(
new XMLInputSource(null,null,null,in,null));
XSNamedMap map = grammer.getComponents(XSConstants.ELEMENT_DECLARATION);
for(int i=0;i<map.getLength();i++){