Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

unable to ignore DOCTYPE during while reading  RSS feed

 
Dinesh nath
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Set an EntityResolver on the parser. Code this EntityResolver to return an empty InputSource when it is requested to resolve that DTD.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!