xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christophe Jolif <cjo...@ilog.fr>
Subject crimson
Date Mon, 12 Mar 2001 15:45:36 GMT

I know that crimson is deprecated but as it is used in Sun JAXP
distribution and as Xerces 2 is still not publically available (as far
as I know), I hope that bug corrections or little enhancements are still
accepted. If I well read Crimson pages, this list seems to be the right
place to share my comments...

So, here is my problem, using the crimson.jar from the JAXP
distribution, running the following test example (just done to
demonstrate my problem):

import org.w3c.dom.*;

import org.apache.crimson.tree.*;

public class BugA
    // CJO 03/2001
    public static void main(String[] arg) {
        XmlDocument doc = new XmlDocument();
        Element elt = doc.createElementNS(null, "foo");
        elt.setAttributeNS(null, "bar", "bar_value");
        elt.getAttributeNS(null, "bar");

I've got the following exception:

Exception in thread "main" java.lang.NullPointerException
        at BugA.main(BugA.java:13)

After checkouting the last crimson code source from Apache I still have
exactly the same error (in ElementNode2.java instead of

I was expecting crimson not to crash on null namespace as this case is
seems legal for DOM spec (for example when explaining when an exception
is thrown when calling Element.setAttributeNS()...).

In case it may help you, you will find below a patch of
ElementNode2.java source code that correct the problem I encounter.

Index: ElementNode2.java
RCS file:
retrieving revision 1.4
diff -c -w -r1.4 ElementNode2.java
*** ElementNode2.java	2001/03/09 01:04:26	1.4
--- ElementNode2.java	2001/03/12 15:00:07
*** 388,394 ****
                  return null;
              if (attr.getLocalName().equals(localName)
!                 && attr.getNamespaceURI().equals(namespaceURI)) {
                  return attr;
--- 388,395 ----
                  return null;
              if (attr.getLocalName().equals(localName)
!                 && ((attr.getNamespaceURI() == null && namespaceURI ==
null) ||
!                     attr.getNamespaceURI().equals(namespaceURI))) {
                  return attr;


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

View raw message