• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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
 
Sheriff
Posts: 28330
97
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
Sheriff
Posts: 28330
97
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 ]
 
Why is the word "abbreviation" so long? And this ad is so short?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic