[jdom-interest] Validation using DOMBuilder

Jason Hunter jhunter at acm.org
Wed May 1 12:16:10 PDT 2002


The only validators out now are those that validate file content when
they're loaded into memory.  There's someone working on a validator that
operates in memory, and that would be the ideal solution for you.  Right
now you want to validate, with JDOM or any API, you'll need to convert
to bytes and read in from bytes.  Yep, it's lousy, and that's why we're
doing something about it!

-jh-

Kevin.Bedell at sunlife.com wrote:
> 
> 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.
> ---------------------------------------------------------------------------
> 
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com



More information about the jdom-interest mailing list