How to report a missing DTD files to the user?

tixco

New Member
Given the code :\[code\]public class ModelHandler{//membersprivate DocumentBuilderFactory m_domFactory;private DocumentBuilder m_builder;private Document m_doc;private XPathFactory m_factory;private List<String> m_inputErrorLog;public void openXmlFile(File file) { this.m_inputErrorLog = new LinkedList<String>() ; try { m_builder = m_domFactory.newDocumentBuilder(); } catch (ParserConfigurationException ex) { m_inputErrorLog.add(ex.getMessage());} try { m_doc = m_builder.parse(file); } catch (Exception ex) { m_inputErrorLog.add(ex.getMessage()); m_domFactory.setValidating(false); } try { getNodesList("/"+m_doc.getDocumentElement().getNodeName()); } catch (XPathExpressionException ex) { m_inputErrorLog.add(ex.getMessage()); }} \[/code\]I want to present to the user that the \[code\]DTD\[/code\] file is missing , while working with \[code\]GUI\[/code\] . How can I do that while trying to open the \[code\]XML\[/code\] file ? Thanks
 
Back
Top