> I need method which allows to check if an XML
> document is valid regards its DTD. is it possible?
> I use JDOM.
But it would be the parser that validates the XML against its DTD. JDOM is not a parser, it uses some other product (which you can specify, I believe) to do the parsing. So the answer would be yes, since parsers do exist that can validate against a DTD.
in fact, I have a DTD, and
in my java code, I products an XML document using DOM.
I hope now (using java) validate the XML against the defined DTD.
can you give me one parser wich can be able to do the validation step? or a link to online document which discribs it ...
thanks,
The online document which describes that is the JDOM FAQ:
http://www.jdom.org/docs/faq.html#a0370
While you are waiting for them to implement that feature, the thing to do is to output the DOM to an XML document, and include the reference to the DTD you want to validate against. Then feed that document into a parser in validating mode.