jQuery in Action, 2nd edition*
The moose likes XML and Related Technologies and the fly likes unable to ignore DOCTYPE during while reading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "unable to ignore DOCTYPE during while reading" Watch "unable to ignore DOCTYPE during while reading" New topic

unable to ignore DOCTYPE during while reading

Dinesh nath

Joined: Dec 16, 2009
Posts: 3
I am trying to read the following xml file

using the below code

I am getting the following error

Nested exception:
java.io.FileNotFoundException: Y:\default\main\example\us\WORKAREA\Corporate\templatedata\picklists\time_zones\data\dcr4.5.dtd (The system cannot find the file specified)

I understand that it is trying to locate the dtd file in the same folder as the file i am trying to parse, the DOCTYPE declaration cannot be removed from xml as the same file is used by another application. I cannot place dtd file in same folder as the xml file Itself.

How can I make the parser to ignore the DOCTYPE or please guide me with an alternate approach?
Paul Clapham

Joined: Oct 14, 2005
Posts: 18541

Set an EntityResolver on the parser. Code this EntityResolver to return an empty InputSource when it is requested to resolve that DTD.
I agree. Here's the link: http://aspose.com/file-tools
subject: unable to ignore DOCTYPE during while reading
Similar Threads
Parse/Validate with DSIG schema issue
XHTML documents vs. XHTML syntax in HTML documents
OO Parsers
Can you find the bug in <div> I do NOT get sample xml data[bookrss.xml]... RSS Client/Server
Converting a string to DOM