>Now I'd like to know, how to parse a given DTD
> separately, so I can use it for validation of
> the new created document.
Right now, the only way to do it is to make a little in memory file that
references the DTD, parse that, which will fill up the DTD. Then, then next
time you call parse(), set the reuseValidator parameter to true. This will
cause it to reuse the validator for subsequent parses.
But, bear in mind that you have a DOM tree, not a document. Right now,
there is no canned way to revalidate a DOM document other than to spool it
back out to a file and validate that (in which case you can just spool out
a DOCTYPE that references you DTD and do it that way.) Or, you'd have to
write something like a DOMInputSource that will input a DOM tree back into
the parser to be validated. Or, you'd have to manually call the validator
APIs yourself, which is something that is not documented yet, and there
would be lots of issues with doing that which would have be dealt with
(because a DOM tree in memory that is programmatically created can have
lots of issues, since it was never normalized.)
----------------------------------------
Dean Roddey
Software Weenie
IBM Center for Java Technology - Silicon Valley
[EMAIL PROTECTED]