[prev in list] [next in list] [prev in thread] [next in thread]
List: xmlbeans-dev
Subject: [jira] [Created] (XMLBEANS-489) Cursor getAllNamespaces not returning default namespace
From: "Jerry Sy (JIRA)" <xmlbeans-dev () xml ! apache ! org>
Date: 2012-09-20 21:18:07
Message-ID: 950536984.104804.1348175887961.JavaMail.jiratomcat () arcas
[Download RAW message or body]
Jerry Sy created XMLBEANS-489:
---------------------------------
Summary: Cursor getAllNamespaces not returning default namespace
Key: XMLBEANS-489
URL: https://issues.apache.org/jira/browse/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 org.apache.xmlbeans.impl.store.Locale 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)
{
continue;
}
from SVN history, it was added in r110897
http://svn.apache.org/viewvc/xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Locale.java?revision=110897&view=markup&pathrev=1386853 \
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
"",""
c1,"namespacec"
which is incorrect, since the default namespace was redeclared in element b, the \
correct return should be "","namespaceb"
c1,"namespacec"
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: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic