[jdom-interest] DOMOutputter and other thoughts

Brett McLaughlin brett.mclaughlin at lutris.com
Mon Jun 12 08:33:25 PDT 2000


Kevin Regan wrote:
> 
> I've been taking a look at the DOMOutputter class
> and it seems that this will need to take a
> org.w3c.dom.DOMImplementation rather than a

Nope - use the JDOM adapters to get a Document from a specific parser
implementation. Nobody is familiar with DOMImplementation anyway...


> org.w3c.dom.Document.  A couple of other issues are present:
> 
> 1) There is no way to implement the Document.getElementById() method
>    in the DOM -- there seems to be no support for or recognition of
>    IDREF in JDOM.

You don't need to implement this method - you aren't implementing DOM in
DOMOutputter, you are creating a DOM Document.

> 
> 2) Even if #1 was implemented, there does not seem to be any way to
>    access ID information directly from a DOM tree (without additional
>    DTD knowledge).  Therefore, ID information can not be moved from
>    a DOM to a JDOM.
> 
> 3) Do we want to handle CDATASections from DOM in some way, or simply
>    pass the text over as a String in JDOM?

For now just throw it over as a String - if/when we add CDATA to JDOM,
we'll cover that then.

> 
> One other thought, just a pie-in-the-sky idea, was to have the
> JDOM classes implement the DOM interface so that they could be
> used directly by DOM applications:
> 
Nope. Already went down that road, and vetoed it heavily. Bad news
(trust us, JDOM alpha 1 was like that, and James Davidson convinced us
otherwise.)

-Brett


> Pros:
> -----
> 
> -- Could use the JDOM in places where a DOM is called for.
> 
> Cons:
> -----
> 
> -- More coding needed.
> -- Larger jdom.jar footprint.
> 
> I'm not sure if this is a good idea.  I just thought I would
> throw it out and get some opinions...
> 
> --Kevin
> 
> _______________________________________________
> 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