Trying to create a GATE document from an XML file that specifies a DTD that is not available (the URL has changed, or it points to a missing local DTD file) produces a ResourceInstantiationException and no document:
gate.creole.ResourceInstantiationException: Couldn't unpack markup in document file:/home/adam/IRT996-FOO.xml!
at gate.corpora.DocumentImpl.init(DocumentImpl.java:250)
at gate.Factory.createResource(Factory.java:385)
at gate.gui.NewResourceDialog$4.run(NewResourceDialog.java:220)
at java.lang.Thread.run(Thread.java:619)
Caused by: gate.util.DocumentFormatException: I/O exception for file:/home/adam/IRT996-FOO.xml
at gate.corpora.XmlDocumentFormat.unpackGeneralXmlMarkup(XmlDocumentFormat.java:338)
at gate.corpora.XmlDocumentFormat.unpackMarkup(XmlDocumentFormat.java:132)
at gate.corpora.XmlDocumentFormat.unpackMarkup(XmlDocumentFormat.java:83)
at gate.corpora.DocumentImpl.init(DocumentImpl.java:245)
... 3 more
Caused by: java.io.FileNotFoundException: http://www.stoa.org/epidoc/dtd/6/tei-epidocFOOO.dtd
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1311)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:945)
at org.apache.xerces.impl.XMLEntityManager.startEntity(XMLEntityManager.java:880)
at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:847)
at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:281)
at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(XMLDocumentScannerImpl.java:959)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:338)
at org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:827)
at org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:757)
at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:148)
at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1168)
at gate.corpora.XmlDocumentFormat.unpackGeneralXmlMarkup(XmlDocumentFormat.java:306)
... 6 more
It would be useful if the XML parser could print a warning and try to parse the document instead, so that the user at least gets a GATE document.