• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Parsing an xml File with DOMParser without a DTD ?

 
Christoph Ehret
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am parsing an XML File using DOMParser from Xerces; I use

It seems that when it cannot find the DTD specified in the xml file xmlDocument , it throws an IOException. So how can I make it work without a DTD ?
Thanks
Chris
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you'd acquire a parser object through a javax.xml.parsers.DocumentBuilderFactory, you could say factory.setValidating(false).
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or you can set a variety of features that may meet your needs. That way you don't have to switch back to the DocumentBuilder if you feel like keeping with the DOMParser, or have a need to keep with it.
 
Christoph Ehret
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot. Setting the feature did it . Thanks .
Chris
[ August 25, 2003: Message edited by: Christoph Ehret ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic