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 Brad OHearne <Br...@careerpath.com> on 2000/08/18 21:44:23 UTC

SAX2 can't find the DTD referenced in my XML file - ALL THE INFO

Ok, this mail constitutes full disclosure.  I have tried this every which
way, and now am using the exact code from SAX2Count.java to create my
parser, to no avail.  My SAX2 parser finds the XML file, but cannot find the
DTD referenced inside the xml file.  I have tried this every which way, but
the same exception is thrown.  

Here is the parser creation code:

XMLReader parser = (XMLReader)Class.forName(parserName).newInstance();
parser.setContentHandler(new FeedHandler(new MapperV2(p)));		
String uri = "file:" +
"c:\\data\\dev\\test\\inproc\\ct.20000802.1346.722544.txt"; 
parser.parse(uri);

NOTES ABOVE: the URI is found, and the file starts to parse.  Here is the
exception thrown:

org.xml.sax.SAXParseException: File "c:/data/dev/test/inproc/DataFeed.dtd"
not found.
	java.lang.Throwable(java.lang.String)
	java.lang.Exception(java.lang.String)
	org.xml.sax.SAXException(java.lang.String)
	org.xml.sax.SAXParseException(java.lang.String, org.xml.sax.Locator)
	void
org.apache.xerces.framework.XMLParser.reportError(org.xml.sax.Locator,
java.lang.String, int, int, java.lang.Object [], int)
	boolean
org.apache.xerces.readers.DefaultEntityHandler.startReadingFromExternalEntit
y(boolean)
	void
org.apache.xerces.readers.DefaultEntityHandler.startReadingFromExternalSubse
t(java.lang.String, java.lang.String, int)
	boolean org.apache.xerces.framework.XMLDTDScanner.scanDoctypeDecl()
	void
org.apache.xerces.framework.XMLDocumentScanner.scanDoctypeDecl(boolean)
	void
org.apache.xerces.framework.XMLDocumentScanner.access$0(org.apache.xerces.fr
amework.XMLDocumentScanner, boolean)
	boolean
org.apache.xerces.framework.XMLDocumentScanner$PrologDispatcher.dispatch(boo
lean)
	boolean
org.apache.xerces.framework.XMLDocumentScanner.parseSome(boolean)
	void
org.apache.xerces.framework.XMLParser.parse(org.xml.sax.InputSource)
	void org.apache.xerces.framework.XMLParser.parse(java.lang.String)

(I cut the last part of the stack off here, as it bears no relevance to the
issue). NOTES ABOVE: I have tried BOTH forward and backward slashes (at the
urging of other technical people here), and a relative path as well.  No
luck.  I get the same problem consistently regardless.

FYI - I am using Visual Age, and Java 1.2.

Someone help!  Thanks!

Brad

RE: SAX2 can't find the DTD referenced in my XML file - ALL THE INFO

Posted by Lawrence Fry <lw...@bbnow.net>.
1. lets see your doc type reference in your xml file...
2. does the file in the dump exist at the location noted?


-----Original Message-----
From: Brad OHearne [mailto:Brad.OHearne@careerpath.com]
Sent: Friday, August 18, 2000 12:44 PM
To: 'xerces-j-dev@xml.apache.org'
Subject: SAX2 can't find the DTD referenced in my XML file - ALL THE
INFO


Ok, this mail constitutes full disclosure.  I have tried this every which
way, and now am using the exact code from SAX2Count.java to create my
parser, to no avail.  My SAX2 parser finds the XML file, but cannot find the
DTD referenced inside the xml file.  I have tried this every which way, but
the same exception is thrown.

Here is the parser creation code:

XMLReader parser = (XMLReader)Class.forName(parserName).newInstance();
parser.setContentHandler(new FeedHandler(new MapperV2(p)));
String uri = "file:" +
"c:\\data\\dev\\test\\inproc\\ct.20000802.1346.722544.txt";
parser.parse(uri);

NOTES ABOVE: the URI is found, and the file starts to parse.  Here is the
exception thrown:

org.xml.sax.SAXParseException: File "c:/data/dev/test/inproc/DataFeed.dtd"
not found.
	java.lang.Throwable(java.lang.String)
	java.lang.Exception(java.lang.String)
	org.xml.sax.SAXException(java.lang.String)
	org.xml.sax.SAXParseException(java.lang.String, org.xml.sax.Locator)
	void
org.apache.xerces.framework.XMLParser.reportError(org.xml.sax.Locator,
java.lang.String, int, int, java.lang.Object [], int)
	boolean
org.apache.xerces.readers.DefaultEntityHandler.startReadingFromExternalEntit
y(boolean)
	void
org.apache.xerces.readers.DefaultEntityHandler.startReadingFromExternalSubse
t(java.lang.String, java.lang.String, int)
	boolean org.apache.xerces.framework.XMLDTDScanner.scanDoctypeDecl()
	void
org.apache.xerces.framework.XMLDocumentScanner.scanDoctypeDecl(boolean)
	void
org.apache.xerces.framework.XMLDocumentScanner.access$0(org.apache.xerces.fr
amework.XMLDocumentScanner, boolean)
	boolean
org.apache.xerces.framework.XMLDocumentScanner$PrologDispatcher.dispatch(boo
lean)
	boolean
org.apache.xerces.framework.XMLDocumentScanner.parseSome(boolean)
	void
org.apache.xerces.framework.XMLParser.parse(org.xml.sax.InputSource)
	void org.apache.xerces.framework.XMLParser.parse(java.lang.String)

(I cut the last part of the stack off here, as it bears no relevance to the
issue). NOTES ABOVE: I have tried BOTH forward and backward slashes (at the
urging of other technical people here), and a relative path as well.  No
luck.  I get the same problem consistently regardless.

FYI - I am using Visual Age, and Java 1.2.

Someone help!  Thanks!

Brad

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org