aspose file tools*
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 Soft Skills this week in the Jobs Discussion 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
Author

unable to ignore DOCTYPE during while reading

Dinesh nath
Greenhorn

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
Bartender

Joined: Oct 14, 2005
Posts: 18987
    
    8

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