Return-Path: Mailing-List: contact general-help@xml.apache.org; run by ezmlm Delivered-To: mailing list general@xml.apache.org Delivered-To: moderator for general@xml.apache.org Received: (qmail 63711 invoked from network); 27 Apr 2000 17:04:51 -0000 Received: from smtppop1.gte.net (207.115.153.20) by locus.apache.org with SMTP; 27 Apr 2000 17:04:51 -0000 Received: from gte.net (crtntx1-ar1-193-172.dsl.gtei.net [4.34.193.172]) by smtppop1.gte.net with ESMTP ; id MAA21284926 Thu, 27 Apr 2000 12:03:26 -0500 (CDT) Sender: bmclaugh@gte.net Message-ID: <39087461.6BDD67A5@gte.net> Date: Thu, 27 Apr 2000 17:09:53 +0000 From: "Brett D. McLaughlin" Reply-To: brett@newInstance.com X-Mailer: Mozilla 4.61 [en] (X11; U; Linux 2.2.12-20 i686) X-Accept-Language: en MIME-Version: 1.0 To: cocoon-dev@xml.apache.org CC: general@jakarta.apache.org, general@xml.apache.org Subject: Re: JDOM and Thank You :) References: <27721519.956845762226.JavaMail.root@mua1.msgto.com> <3908714F.D5863323@apache.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Mike Pogue wrote: > > Could somebody who was there summarize how it differs from > JSR031 (Java Data Binding)? Sure... as the author, I suppose I'm qualified ;-) JDOM is not about data binding. It's also not about extending, wrapping, or anything else related to DOM. It doesn't implement any w3c interfaces, as we believe that DOM is bloated and not useful in 80% (if not more) of the cases you want to use it in. JDOM is an /alternative/ to DOM and SAX. It provides a fast, Java-optimized method of reading, writing, and manipulating XML. (Btw, the PowerPoint slides just went up on the website - check download/docs. PDF coming in an hour or so). DOM is trying to be a cross-platform, 100% accurate representation of an XML document. We don't believe that in most cases, Java developers need that. THey want an intuitive, usable means of accessing XML data. For example: // This does *not* work, even though it is intuitive String elementValue = element.getValue(); // This works (most of the time!) String elementValue = element.getFirstChild().getValue(); That is ridiculous for a non-XML guru, non-tree-guru, Java programmer. What is intutive is: String elementValue = element.getContent(); Boom. I'm done. No casting, no anything (many more examples are in the slides and code). However, in reference to Ray, we are completely operable with DOM and SAX. You can build a JDOM Document using DOM or SAX (in a completely vendor-neutral way, something not even JAXP offers today except for DOM Level 1), and you can output to DOM or SAX. But the idea is why deal with those APIs yourselves, when you don't have to? We solve that problem by completely uncoupling input from use from output. You can get and send data to other components in any way you wish (including non-XML formats), without losing out on standards (until everyone goes JDOM ;-) ); but in the middle, save yourselves some headaches, and take a look at JDOM. http://jdom.org -Brett > > Mike > > Ray Cromwell wrote: > > > > Could you summarize at a 30,000ft level what it does and why it is > > needed? I tried going to the web site, but there were no specs. > > Browsing the JavaDoc gave me the impression it's intended to allow > > I/O of XML from storage other than just text. > > > > However, one thing concerned me was that the JavaDoc didn't say > > that their versions of Node, Element, et al, implemented the > > org.w3c.* interfaces. IMHO, any API that doesn't atleast implement > > the w3c interfaces is dead-on-arrival. > > > > Building at a higher level on top of DOM, extending it, wrapping it, > > etc I can see, but I wouldn't use an API that didn't atleast give > > me a DOM interface when I needed it. Interoperability is far more > > important than syntactic sugar. > > > > Just my two cents. I'd appreciate a summary of it, since the web > > site doesn't explain much. > > > > -Ray > > > > Ray Cromwell > > MsgTo.Com, Inc. > > ray@MsgTo.com > > > > general@jakarta.apache.org wrote: > > > > > >I've spent a nice evening listening to Jason Hunter and Brett > > >McLaughlin's talk at the Mountain View Java User's Group about their > > >idea of JDOM. > > >What's JDOM? A smarter way (designed and specifically optimized for > > >Java) to handle XML data. > > >Since I really enjoyed their talk (trying - unsuccessfully - to play the > > >devil's advocate for the whole evening) and I think they come up with a > > >good API, I would suggest to all those interested in dealing w/ XML data > > >and DOMs to take a look at and to help those two > > >out with some feedback (and maybe some code? it's not that hard?). > > >Have fun :) :) > > > > > > Pier > > > > > >-- > > >---------------------------------------------------------------------- > > >pier: stable structure erected over water to allow docking of seacraft > > > > > >---------------------------------------------------------------------- > > > > > >--------------------------------------------------------------------- > > >To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org > > >For additional commands, e-mail: general-help@jakarta.apache.org > > > > > > > ---------- > > Message To Spammers -- Game Over! Get spam-free email at http://www.MsgTo.com