• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IN Memory DOM document validation

 
prashant patel
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to run the XML document through DocumentBuilder#parse() so that the DocumentBuilder in question is a validating parser.

I.e.

If the document doesn't validate against its DTD, the parse() method throws an exception.
 
prashant patel
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks will try that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic