Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

problem finding DTD when parsing

843834Mar 25 2004 — edited Mar 25 2004
I'm trying to parse an XML string that I get back from a server. The XML starts off like this:
<?xml version="1.0" standalone="no"?>
<!DOCTYPE RETS SYSTEM "RETS-20021015.dtd">
and I'm parsing it like this:
InputSource source = new InputSource(new StringReader(propertiesXML));
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document propertiesDoc = builder.parse(source);
I get this error:
java.io.FileNotFoundException: C:\Documents and Settings\jessevitrone\IdeaProjects\AgentScape\RETS-20021015.dtd (The system cannot find the file specified)
	at java.io.FileInputStream.open(Native Method)
	at java.io.FileInputStream.<init>(FileInputStream.java:106)
	at java.io.FileInputStream.<init>(FileInputStream.java:66)
	at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:69)
	at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:156)
	at java.net.URL.openStream(URL.java:913)
	at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:947)
	at org.apache.xerces.impl.XMLEntityManager.startEntity(XMLEntityManager.java:893)
	at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:860)
	at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:288)
	at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(XMLDocumentScannerImpl.java:911)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:348)
	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:539)
	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:595)
	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
	at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:253)
	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:206)
It looks like it's not finding that DTD. I have that DTD is the root of my classpath. Shouldn't it find it?

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 22 2004
Added on Mar 25 2004
5 comments
295 views