Jerry Sy created XMLBEANS-489:

             Summary: Cursor getAllNamespaces not returning default namespace
                 Key: XMLBEANS-489
             Project: XMLBeans
          Issue Type: Bug
          Components: Cursor
    Affects Versions: Version 2.6
            Reporter: Jerry Sy

the Cursor getAllNamespaces API is not returning the default namespace that is 
in scope for an element.
In class, line 2316 is this code, which 
intentionally omits the default namespace from the mapping. 

                    // Here I check to see if there is a default namespace
                    // mapping which is not empty on a non root container which
                    // is in a namespace.  This this case, I do not want to add
                    // this mapping because it could not be persisted out this
                    // way.

                    if (prefix.length() == 0 && uri.length() > 0 &&
                        cName != null &&
                        cName.getNamespaceURI().length() > 0)

from SVN history, it was added  in r110897

As an example, given
<a xmln=""><b xmlns="namespaceb"><c xmlns:c1="namespacec"/></b></a>

Using Cursor API, navigate to element c then call getAllNamespaces, it returns
which is incorrect, since the default namespace was redeclared in element b, 
the correct return should be

The proposed fix is to comment out that "if" block. I have tested that fix to 
pass checkintest.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to