You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by Christophe Jolif <cj...@ilog.fr> on 2002/02/19 19:59:32 UTC

[crimson] bug on ElementNode2.getAttributeNodeNS

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


Re: [crimson] bug on ElementNode2.getAttributeNodeNS

Posted by Christophe Jolif <cj...@ilog.fr>.

Edwin Goei wrote:


> 
> Thanks for the patch.  Would you mind creating a bug report under
> category crimson?


Done. #6607



-- 
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


Re: [crimson] bug on ElementNode2.getAttributeNodeNS

Posted by Edwin Goei <ed...@sun.com>.
Christophe Jolif wrote:
> 
> 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

Thanks for the patch.  Would you mind creating a bug report under
category crimson?

-Edwin

---------------------------------------------------------------------
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