xmlgraphics-batik-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 49707] Mix of qualified and local names for AbstractElement.setAttributeNS
Date Fri, 20 Aug 2010 05:31:41 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=49707

--- Comment #2 from Marchant Jean-Fran├žois <jfm@macqel.eu> 2010-08-20 01:31:35 EDT
---
I do not understand your comment.
Here another way of explaining what I found in your code.

YOUR code in the library is:
    public void setAttributeNS(String namespaceURI,
                               String qualifiedName,
                                      ^^^^^^^^^^^^^^
you want a QUALIFIED name as 2nd argument; ok that is as in W3C DOM
documentation
                               String value) throws DOMException {

        if (attributes == null) {
            attributes = createAttributes();
        }
        if (namespaceURI != null && namespaceURI.length() == 0) {
            namespaceURI = null;
        }
        Attr attr = getAttributeNodeNS(namespaceURI, qualifiedName);
                                                     ^^^^^^^^^^^^^
Here you give a QUALIFIED name as argument but as explained in the  online
documentation, getAttributeNodeNS NEED a LOCAL name. So you have the incorrect
behaviour I have explained in my first comment

        if (attr == null) {
            attr = getOwnerDocument().createAttributeNS(namespaceURI,
                                                        qualifiedName);
            attr.setValue(value);
            attributes.setNamedItemNS(attr);
        } else {
            attr.setValue(value);
        }
    }

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org


Mime
View raw message