nsochele    2003/09/23 11:11:47

  Modified:    test-resources/org/apache/batik/dom bug18143.svg
               sources/org/apache/batik/dom AbstractElement.java
  Log:
  removeAttributeNode was no longer working with attributes without namespace
  check for namespace before removing now
  update test case to test both attribute with and without namespace
  
  Revision  Changes    Path
  1.3       +12 -3     xml-batik/test-resources/org/apache/batik/dom/bug18143.svg
  
  Index: bug18143.svg
  ===================================================================
  RCS file: /home/cvs/xml-batik/test-resources/org/apache/batik/dom/bug18143.svg,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- bug18143.svg      8 Aug 2003 11:39:45 -0000       1.2
  +++ bug18143.svg      23 Sep 2003 18:11:47 -0000      1.3
  @@ -75,8 +75,17 @@
          t.setAttributeNS("http://foo.com";, "foo:bar", "barValue"); 
          var an = t.getAttributeNodeNS("http://foo.com";, "bar");
          t.removeAttributeNode(an);
  -       t.setAttributeNS(null, "fill", "#0F0");
  -       result.setAttributeNS(null, "result", "passed");
  +
  +       t.setAttribute("fake-attribute","fake-value");
  +       an = t.getAttributeNode("fake-attribute");
  +       t.removeAttributeNode(an);
  +
  +       if ( !t.hasAttributeNS("http://foo.com";, "bar") &&
  +            !t.hasAttribute("fake-attribute") )
  +       {
  +         t.setAttributeNS(null, "fill", "#0F0");
  +         result.setAttributeNS(null, "result", "passed");
  +       }
      }
   
   </script>
  
  
  
  1.23      +6 -3      xml-batik/sources/org/apache/batik/dom/AbstractElement.java
  
  Index: AbstractElement.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/dom/AbstractElement.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- AbstractElement.java      8 Aug 2003 11:38:58 -0000       1.22
  +++ AbstractElement.java      23 Sep 2003 18:11:47 -0000      1.23
  @@ -215,8 +215,11 @@
                                     "attribute.missing",
                                     new Object[] { oldAttr.getName() });
        }
  -     return (Attr)attributes.removeNamedItemNS(oldAttr.getNamespaceURI(),
  -                                                  oldAttr.getLocalName());
  +        String nsURI = oldAttr.getNamespaceURI();
  +     return (Attr)attributes.removeNamedItemNS(nsURI,
  +                                                  (nsURI==null
  +                                                   ? oldAttr.getNodeName()
  +                                                   : oldAttr.getLocalName()));
       }
   
       /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to