Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How do I ignore "The entity "raquo" was referenced, but not declared." exceptions?

 
Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm using Java 6. I have this code for turning a well-formed XML string (derived from an XHTML doc) into a org.w3c.dom.Document ...



I thought the line, "factory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);" would tell the parser to ignore entities it cannot resolve, but I still get the exception



Is there a way to tell the parser to ignore entities it cannot resolve? I would prefer not to create my own custom entity resolver or alter the HTML, but if there is no other way, then so be it.

Thanks, - Dave
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!