cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brett D. McLaughlin" <new.insta...@gte.net>
Subject Re: JDOM and Thank You :)
Date Thu, 27 Apr 2000 18:01:31 GMT
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
>                     <mengelhart@eart        To:     cocoon-dev@xml.apache.org
>                     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:
> >
> > <dom-code>
> > // This does *not* work, even though it is intuitive
> > String elementValue = element.getValue();
> > // This works (most of the time!)
> > String elementValue = element.getFirstChild().getValue();
> > </dom-code>
> 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

Mime
View raw message