[jdom-commits] CVS update: jdom/src/java/org/jdom/output

cvs at jools.org cvs at jools.org
Tue Apr 16 09:25:26 PDT 2002


Date:	Tuesday April 16, 2002 @ 12:25
Author:	cvs

Update of /home/cvspublic/jdom/src/java/org/jdom/output
In directory jools.org:/tmp/cvs-serv26252

Modified Files:
	DOMOutputter.java 
Log Message:
Deprecated the DOMOutputter output methods that return a DOM Element
or Attr, because as elharo says they aren't truly useful.  Here's his
reasoning:

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.

-jh-

===================================================================
File: no file DOMOutputter.java		Status: Needs Checkout

   Working revision:	1.30	Tue Apr 16 16:25:26 2002
   Repository revision:	1.30	/home/cvspublic/jdom/src/java/org/jdom/output/DOMOutputter.java,v

   Existing Tags:
	jdom_1_0_b8              	(revision: 1.28)
	jdom_1_0_b8_rc1          	(revision: 1.28)
	jdom_prefilter           	(revision: 1.25)
	jdom_1_0_b7              	(revision: 1.25)
	jdom_1_0_b6              	(revision: 1.16)
	start                    	(revision: 1.1.1.1)
	jdom                     	(branch: 1.1.1)




More information about the jdom-commits mailing list