You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Langdon, Brent" <bl...@proxicom.com> on 2001/02/06 21:06:58 UTC

Parse cannot locate dtd file

I am new to this list and relatively new to Xerces.  I checked the archives,
but they are rather hard to use without search facilities.

I am using the SAX parser in Xerces 1.3 running on Solaris.  My xml
documents contain the following doctype entry:

    <!DOCTYPE InventorySnapshot SYSTEM "../dtd/InventorySnapshot.dtd" >

When I attempt to parse this document, I the dtd cannot be found and the
parser throws an exception (see below for the full stack trace).  The
exception message is:

    File
"file:///raid/blangdon/chelsea_devel/build/dtd/InventorySnapshot.dtd" not
found

The xml file is in the directory /raid/nfs/ike_sand1/shared/xml/invt_in/.
Shouldn't the parser look for the dtd path relative to the xml document
path?  Instead it seem to be looking relative to the current working
directory.

Is there a property that I need to set or something else I need to do to get
the parser to find the dtd relative to the xml file?

The stack trace:
org.xml.sax.SAXParseException: File
"file:///raid/blangdon/chelsea_devel/build/dtd/InventorySnapshot.dtd" not
found.
        at java.lang.Throwable.fillInStackTrace(Native Method)
        at java.lang.Throwable.fillInStackTrace(Compiled Code)
        at java.lang.Throwable.<init>(Compiled Code)
        at java.lang.Exception.<init>(Compiled Code)
        at org.xml.sax.SAXException.<init>(SAXException.java:45)
        at org.xml.sax.SAXParseException.<init>(SAXParseException.java:56)
        at
org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1062)
        at
org.apache.xerces.readers.DefaultEntityHandler.startReadingFromExternalEntit
y(DefaultEntityHandler.java:788)
        at
org.apache.xerces.readers.DefaultEntityHandler.startReadingFromExternalSubse
t(DefaultEntityHandler.java:566)
        at
org.apache.xerces.framework.XMLDTDScanner.scanDoctypeDecl(XMLDTDScanner.java
:1139)
        at
org.apache.xerces.framework.XMLDocumentScanner.scanDoctypeDecl(XMLDocumentSc
anner.java:2192)
        at
org.apache.xerces.framework.XMLDocumentScanner.access$000(Compiled Code)
        at
org.apache.xerces.framework.XMLDocumentScanner$PrologDispatcher.dispatch(Com
piled Code)
        at org.apache.xerces.framework.XMLDocumentScanner.parseSome(Compiled
Code)
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:948)
        at
net.chelseai.xml.InventoryXMLHandler.processFile(InventoryXMLHandler.java:92
)
        at
net.chelseai.xml.InventoryConvertApp.processFile(InventoryConvertApp.java:22
4)
        at net.chelseai.util.FileProcessor.processFiles(Compiled Code)
        at net.chelseai.util.FileProcessor.run(Compiled Code)
        at
net.chelseai.xml.InventoryConvertApp.main(InventoryConvertApp.java:43)

thanks,
Brent Langdon
Senior Consultant - Proxicom, Inc.
703.438.2665 - blangdon@proxicom.com