xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christophe Jolif <cjo...@ilog.fr>
Subject [crimson] bug on ElementNode2.getAttributeNodeNS
Date Tue, 19 Feb 2002 18:59:32 GMT
Hi,

The following small test case crashes with crimson (cvs snapshot):

import org.w3c.dom.*;

import org.apache.crimson.tree.*;

public class BugB
{
     // CJO 02/2002
     public static void main(String[] arg) {
	// directly create XmlDocument just for the prupose
	// of having a smaller test...
         XmlDocument doc = new XmlDocument();
         Element elt = doc.createElementNS(null, "foo");
         doc.appendChild(elt);
         elt.setAttributeNS(null, "bar", "bar_value");
	// this line should not return the previous
	// element has the namespace is not the same
	// but it should not crash either...
         elt.getAttributeNS("myNS", "bar");
     }
}

A patch could be:

diff -h -r1.11 ElementNode2.java
434,435c434,436
<                     || attr.getNamespaceURI().equals(namespaceURI))) {
<                 return attr;
---
 >                     || (attr.getNamespaceURI() != null &&
 >                       attr.getNamespaceURI().equals(namespaceURI)))) {
 >             return attr;
437c438
<         }
---
 >       }
439c440
<
---
 >


Thanks.
-- 
Christophe


---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org


Mime
View raw message