Hi all, Is there a way to validation a DOM docuement which i created in memory(on loaded from a file) and validate is against a DTD. I am using the "SYSTEM" in DOCTYPE which point to a directory containing a DTD.
posted 13 years ago
You need to run the XML document through DocumentBuilder#parse() so that the DocumentBuilder in question is a validating parser.
If the document doesn't validate against its DTD, the parse() method throws an exception.