0

I need to validate external XML document against DTD, that's stored in my jar. But the problem is, that this document probably don't have <!DOCTYPE declaration. So, I can't just setEntityResolver.

I'm using SAXParserFactory, because this document might be very large. I have figured out how to do it with XSD - I simply create a new Schema and then set it to SAXParserFactory. But this approach don't work with DTD.

But I definitely need to do that with DTD, not XSD. Because DTD is pretty complex and it's not trivial to convert it to XSD.

So, is there a way?

hades
  • 1,077
  • 3
  • 11
  • 19
  • 3
    [Possible duplicate](http://stackoverflow.com/questions/1096365/validate-an-xml-file-against-local-dtd-file-with-java) – npe Jun 03 '12 at 11:22
  • 1
    @npe, Hm. Seems that solution with transformation sucks. Because it'll create a new document in-memory. – hades Jun 03 '12 at 21:44

0 Answers0