[jdom-interest] Validation using DOMBuilder

Kevin.Bedell at sunlife.com Kevin.Bedell at sunlife.com
Wed May 1 11:27:44 PDT 2002


Hello -

I'm new to the list though I've been using JDOM since I bought the first
edition of the Java XML book. I once taught an XML class and specified the
first edition as the text book - about 30 copies worth!

Anyway, I'm using JDOM now on a web services project where I receive an
org.w3c.dom.Document from the web sevice. I receive the
org.w3c.dom.Document and immediately use it to construct an
org.jdom.Document.

I use this code fragment to do the transformation:

        // Convert the XML Document object from DOM to JDOM
        org.jdom.input.DOMBuilder jdomBuilder = new org.jdom.input.DOMBuilder();
        org.jdom.Document requestJDOMDoc = jdomBuilder.build(requestDOMDoc);

What I'd like to do is specify a DTD and have my DOMBuilder perform
validation when I call jdomBuilder.build(requestDOMDoc). What I have to do
otherwise is "manually" validate the xml after I get back an
org.jdom.Document.

How would I modify the code fragment to accomplish this (assuming I
can....)?

Thanks -

Kevin


---------------------------------------------------------------------------
This e-mail message (including attachments, if any) is intended for the use
of the individual or entity to which it is addressed and may contain
information that is privileged, proprietary , confidential and exempt from
disclosure.  If you are not the intended recipient, you are notified that
any dissemination, distribution or copying of this communication is
strictly prohibited.  If you have received this communication in error,
please notify the sender and erase this e-mail message immediately.
---------------------------------------------------------------------------





More information about the jdom-interest mailing list