Given the code :
public class ModelHandler
{
//members
private 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());
}
}
I want to present to the user that the DTD
file is missing , while working with GUI
.
How can I do that while trying to open the XML
file ?
Thanks