[jdom-commits] CVS Update: jdom/src/java/org/jdom

Jason Hunter jhunter at servlets.kattare.com
Wed Nov 21 23:00:38 PST 2007

Date:   Wed Nov 21, 2007 @23:00:38 PST

Update of /home/cvs/jdom/src/java/org/jdom
In directory servlets:/tmp/cvs-serv32156

Modified Files:
Log Message:
Fixed bug reported at http://www.junlu.com/msg/166290.html:
I got an exception when I executed code along the lines of the following:

Namespace ns1 = Namespace.getNamespace("aaa", "http://acme.com/aaa");
Element e = new Element("aaa", ns1);
e.setAttribute("att1", "att1");
Namespace defns = Namespace.getNamespace("http://acme.com/default");

I want to declare an element that is in the 'aaa' namespace but that also
declares a default namespace that is inherited by other elements. However, I
get this exception:

org.jdom.IllegalAddException Source code of org.jdom.IllegalAddException: The
namespace xmlns="http://acme.com/default"
could not be added as a namespace to "aaa:aaa": The namespace prefix ""
collides with an attribute namespace prefix on the element

I think that the code in the Verifier is incorrect. It seems to assume that
attributes that have no explicit namespace are in the default namespace. This
is not my understanding of the XML spec.

Reported again today by Jeff Dalton. Just missed the JDOM 1.1 cutoff.


File: no file Verifier.java		Status: Needs Checkout

   Working revision:	1.56	Thu Nov 22 07:00:38 2007
   Repository revision:	1.56	/home/cvs/jdom/src/java/org/jdom/Verifier.java,v

   Existing Tags:
	jdom_1_1                 	(revision: 1.55)
	jdom_1_0                 	(revision: 1.51)
	jdom_1_0_rc1             	(revision: 1.51)
	BEFORE_UNCHECKED         	(revision: 1.49)
	jdom_1_0_b10             	(revision: 1.49)
	jdom_1_0_b10_rc1         	(revision: 1.49)
	after_rolf               	(revision: 1.48)
	before_rolf              	(revision: 1.48)
	jdom_1_0_b9              	(revision: 1.44)
	jdom_1_0_b8              	(revision: 1.32)
	jdom_prefilter           	(revision: 1.23)
	jdom_1_0_b7              	(revision: 1.23)
	jdom_1_0_b6              	(revision: 1.19)
	start                    	(revision:
	jdom                     	(branch: 1.1.1)

More information about the jdom-commits mailing list