DTD/Schema access, caching, and re-validation is being investigated. These
issues
are also on the table for DOM Level 3 discussion.
Currently, your method of writing XML and re-parsing - however convoluted - is
the
easiest.
Regards,
-Ralf
There is no direct way to validate a DOM document in memory against
a DTD. Only the parser is able to validate a document, which
happens at the time the document is being read.
So what you are doing already is the probably your best option.
Adding some new facility to do what you want is on