• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How do i surpass DTD Entry while Parsing XML

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to avoid parsing .xml file using SAXON by not reading DTD entry.My XML file doesnt has DTD entry (niether Internal nor External).So when i try to parse the xml i am getting exception from SAXON. Is there is any way that i can avoid looking for DTD entry and Parse XML file.The urgent help required.

Lot Thanks in Advance.

Praveen
 
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your XML contains a reference to a DTD that can't be resolved? Then write an EntityResolver and apply it to your parser by calling setEntityResolver. Your EntityResolver should be just like the example in the API documentation for org.xml.sax.EntityResolver, but it should return
 
Praveen Indraiah
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Paul,

No.. here my XML doesnt have any DTD reference. I have removed DTD entry for some reason.And when i try to parse this xml the parser tries to find associated DTD and when it doesnt find entry it just throws exception.

Regards,
Praveen
[ March 15, 2006: Message edited by: Praveen Indraiah ]
 
Paul Clapham
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you try what I suggested?
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you can resolve this by seting the validation false.

SAXParserFactoryObject.setValidating(false) // if you are using SAX parser
or
DocumentBuilderFactoryObject.setValidating(false) //if using DOM parser

Hope this helps.
[ March 17, 2006: Message edited by: Amy Medrat ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic