[ 
https://issues.apache.org/jira/browse/ODE-188?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Matthieu Riou resolved ODE-188.
-------------------------------

    Resolution: Fixed

Committed a fix that copies the missing namespace declarations from the context.

> Sometimes namespaces are messed up by assignment when the resulting DOMs are 
> sent outside of the engine
> -------------------------------------------------------------------------------------------------------
>
>                 Key: ODE-188
>                 URL: https://issues.apache.org/jira/browse/ODE-188
>             Project: ODE
>          Issue Type: Bug
>          Components: BPEL Runtime
>    Affects Versions: 1.1
>            Reporter: Matthieu Riou
>            Assignee: Matthieu Riou
>             Fix For: 1.1.1
>
>
> Assignment uses Xerces importNode to get a node from one tree and copy it 
> into another. More specifically it recreates an element and imports all its 
> child nodes (attributes and elements). However Xerces doesn't carry the full 
> namespace context on import, it just clones and sets the proper owner. When 
> it clones, it also takes the namespace property so the cloned element is in 
> the proper namespace even without namespace declaration. Then internally 
> Xerces knows hoe to deal with that and eventually adds a namespace 
> declaration when needed.
> However when we take that sort-of-messed-up tree as is and send it to the IL 
> (to ServiceMix for example), we don't know who or what is eventually going to 
> marshal the tree. And some of those marshallers don't really like Xerces 
> tricks and end up with a node using a namespace prefix that has never been 
> declared. Which of course can't be unmarshalled anymore as it's invalid. 
> Nasty stuff.
> As an example if you take those from and to:
>             "<ns2:detail xmlns:ns=\"http://www.etnic.be/janus/fault/desc\"; 
> xmlns:ns2=\"http://www.etnic.be/janus/fault\";>" +
>                 "<ns:description ns:lang=\"fr\">foo bar</ns:description>" +
>             "</ns2:detail>";
>             "<janusResponse xmlns=\"http://www.etnic.be/janus\"; 
> xmlns:janus=\"http://www.etnic.be/janus\";>" +
>                 "<fault:detail 
> xmlns:fault=\"http://www.etnic.be/janus/fault\";>" +
>                     "<fault:description/>" +
>                 "</fault:detail>" +
>             "</janusResponse>";
> And assign the destination node of the first in the second, you end up with:
> <janusResponse xmlns="http://www.etnic.be/janus"; 
> xmlns:janus="http://www.etnic.be/janus";>
>   <fault:detail xmlns:fault="http://www.etnic.be/janus/fault";>
>     <description ns:lang="fr">foo bar</description>
>   </fault:detail>
> </janusResponse>
> Note that there's no declaration for the prefix ns used by the lang 
> attributes and also that the namespace for the description element has 
> changed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to