[jdom-interest] parentless DOM nodes created by DOMOutputter

Alex Rosen arosen at silverstream.com
Wed Apr 17 12:41:08 PDT 2002


Couldn't we just let the user pass in the DOM Document for us to use? Seems
easy, but looking at the DOMOutputter code and not understanding it at all,
I'm not sure.

Alex

> -----Original Message-----
> From: jdom-interest-admin at jdom.org
> [mailto:jdom-interest-admin at jdom.org]On Behalf Of Elliotte
> Rusty Harold
> Sent: Friday, April 12, 2002 4:13 PM
> To: jdom-interest
> Subject: [jdom-interest] parentless DOM nodes created by DOMOutputter
>
>
> The DOMOutputter class contains these two methods:
>
> public org.w3c.dom.Element *output*(Element
> <http://www.jdom.org/docs/apidocs/org/jdom/Element.html>  element)
> throws JDOMException
> <http://www.jdom.org/docs/apidocs/org/jdom/JDOMException.html>
> public org.w3c.dom.Attr *output*(Attribute
> <http://www.jdom.org/docs/apidocs/org/jdom/Attribute.html>
> attribute)
> throws JDOMException
> <http://www.jdom.org/docs/apidocs/org/jdom/JDOMException.html>
>
> The DOM contract is that every Attr and Element (and every other Node
> too) always belongs to exactly one Documnt or
> DocumentFragment object.
> What document would the return values of these methods be
> placed in? Or
> are we violating the DOM contract somehow with these two
> methods? Even
> if we manage to create orphan nodes, since the ownerDocument
> attribute
> in Node is read-only, these nodes we create cannot be adopted into a
> different DOM document. I suggest we remove these methods, possibly
> after deprecating them for a release cycle, though I doubt very much
> anyone is using them.
>
> --
> +-----------------------+------------------------+-------------------+
> | Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
> +-----------------------+------------------------+------------
> -------+
> |           The XML Bible, 2nd Edition (IDG Books, 2001)             |
> |             http://www.cafeconleche.org/books/bible2/              |
> |   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
> +----------------------------------+---------------------------------+
> |  Read Cafe au Lait for Java News:
http://www.cafeaulait.org/     |
|  Read Cafe con Leche for XML News:  http://www.cafeconleche.org/   |
+----------------------------------+---------------------------------+



_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com




More information about the jdom-interest mailing list