Return-Path: Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 31850 invoked from network); 27 Apr 2000 22:08:13 -0000 Received: from unknown (HELO mail.exoffice.com) (root@207.33.160.102) by locus.apache.org with SMTP; 27 Apr 2000 22:08:13 -0000 Received: from exoffice.com (fwin.exoffice.com [207.33.160.97]) by mail.exoffice.com (8.9.3/8.9.3) with ESMTP id PAA05237 for ; Thu, 27 Apr 2000 15:08:26 -0700 Message-ID: <3908BB04.47435FDD@exoffice.com> Date: Thu, 27 Apr 2000 15:11:16 -0700 From: Keith Visco Organization: Exoffice Technologies, Inc X-Mailer: Mozilla 4.7 [en] (WinNT; I) X-Accept-Language: en MIME-Version: 1.0 To: cocoon-dev@xml.apache.org Subject: Re: JDOM and Thank You :) References: <3908807B.30FE85F4@gte.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Brett, Personally your API looks very much like the W3C DOM. And if you add back in the multi-directional (children/parents/sibling) node traversal, you are back to DOM. Of course you've added support for Namespace handling, which DOM level 1.0 doesn't address (mainly because it wasn't relavant at the time), but DOM level 2.0 does address. One difference I do see is the Element#getContent() method. I actually don't like this because it removes document order, and I think any good "Document Object Model" (i.e. something modeling the document and not the data) should preseve document order. So unless I've failed to see something here, I don't understand what JDOM is actually providing which is supposedly better than DOM? Just my $0.02 --Keith "Brett D. McLaughlin" wrote: > > Scott Boag/CAM/Lotus wrote: > > > > I don't believe JDOM will work with Xalan, or any other XSLT processors > > that I know of, unless you produce SAX events (or a DOM) from the JDOM. > > SAXOutputter and DOMOutputter do just that. So you can use them with > any XML component that gives or receives DOM or SAX - that means pretty > much everything. > > > Xalan can't use JDOM internally, for one reason, because you can't traverse > > up from a Node, and, for another, I believe it is important for Xalan to be > > compatible with the DOM (including the interface model, which allows Xalan > > to walk many tree implementations). > > Today, I'd afree with you. JDOM is too new. But 6 months from now? > That may be a different story. Additionally, we are discussing > traversing nodes right now, and if that is functionality that might be > needed. > > Cocoon should really use SAX2, and it > > should not care about tree object models, in my opinion. > > We'll see... SAX2 is a pain to code for - event handlers are great in > some cases, horrible in others. I foresee a lot of places JDOM can be > useful in Cocoon - I've already got some folks interested in it for > certain applications. Only time will tell... > > However, in response to your main point, JDOM will maintain complete > interoperability with DOM and SAX for as long as those APIs are heavily > used. > > -Brett > > > > > -scott > > > > > > Mike Engelhart > > > htrip.com> cc: (bcc: Scott Boag/CAM/Lotus) > > Subject: Re: JDOM and Thank You :) > > 04/27/2000 01:15 > > PM > > Please respond > > to cocoon-dev > > > > > > > > Brett D. McLaughlin wrote: > > > > > 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(); > > > > > awww yeah!!! > > > > Thanks for this! I hated the W3C DOM API!!!! Apparently you and Jason did > > too :-) > > > > one question -have you tested it's interoperability with Cocoon 1.x (and/or > > 2.x)?? > > Scenario: > > I'm about to rewrite some code to take data from a result set and want to > > put it directly into an XML fragment rather than an intermediate ArrayList. > > Can I use JDOM for this and hand a Node off to an XSP page for further > > processing using Xerces?? Please??? :-) > > > > thanks again... > > > > mike