[ 
https://issues.apache.org/jira/browse/MUSE-181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12465332
 ] 

Dan Jemiolo commented on MUSE-181:
----------------------------------

In looking at the code (particularly your use of XmlUtils.getAllNamespaces()), 
I'm thinking that the only 'duplicate' may be the prefix/namespace of the 
element name (in your case, ns1). getAllNamespaces() only returns namespaces 
from element names in the fragment, so the patch wouldn't be protecting you 
against non-element-name namespace duplication.

does the code still work if you change it like this:

i = axiom.getAllDeclaredNamespaces();
String domURI = dom.getNamespaceURI();

while (i.hasNext())
{
    OMNamespace ns = (OMNamespace)i.next();
    String prefix = ns.getPrefix();
    String uri = ns.getNamespaceURI();

    if (!uri.equals(domURI))
        XmlUtils.setNamespaceAttribute(dom, prefix, uri);
}



if so, that would be preferable, because it would be much less expensive from a 
performance standpoint (XmlUtils.getAllNamespaces() traverses the whole XML 
fragment to build the Map).


> Axis Environment adds dupilicate namespaces when converting axiom nodes to 
> dom nodes
> ------------------------------------------------------------------------------------
>
>                 Key: MUSE-181
>                 URL: https://issues.apache.org/jira/browse/MUSE-181
>             Project: Muse
>          Issue Type: Bug
>          Components: Deployment - Axis2
>    Affects Versions: 2.1.0
>         Environment: muse on axis2
>            Reporter: Mohammad Fakhar
>         Assigned To: Dan Jemiolo
>             Fix For: 2.2.0
>
>         Attachments: axis_env_dup_ns_patch
>
>
> The convertToDOM method in AxisEnvironment declares identical namespaces - 
> i.e. namespaces with the same prefix and same namespace uri - when converting 
> axiom nodes to DOM nodes. This leads to unexpected 500 errors in the axis 
> engine. 
> I fixed the code to ensure that no identical namespaces are declared on the 
> DOM. I will be attaching a patch.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Reply via email to