[ 
https://issues.apache.org/jira/browse/ODE-663?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12854107#action_12854107
 ] 

Mark Ford commented on ODE-663:
-------------------------------

I'm not suggesting that the clone or import feature in DOM is broken but rather 
that it isn't well suited to this problem or at least is insufficient on its 
own to properly clone some nodes. Your point about namespace prefixes changing 
or being remapped is really only a problem when you are copying between nodes 
and have embedded QNames. This aspect of XML serialization is particularly ugly 
and difficult to get right in all cases.

As for your second example, ns:child1 should expand to 
http://www.example.org/ns1#child1.

I think the code needs to traverse the DOM and copy the nodes from the source 
to a new target node. If it's failing in the above use case (which it was when 
I wrote the bug) then there's a bug in it somewhere but obviously not too 
serious or it would have been fixed by now. I also think the code needs to do 
this traversal to address the immutable DOM problem from Saxon XQuery which I 
have since confirmed to be true. 

> DOMUtils.cloneNode results in invalid namespace declaration
> -----------------------------------------------------------
>
>                 Key: ODE-663
>                 URL: https://issues.apache.org/jira/browse/ODE-663
>             Project: ODE
>          Issue Type: Bug
>          Components: BPEL Runtime
>    Affects Versions: 1.3.3, 1.3.4
>            Reporter: Mark Ford
>            Assignee: Karthick Sankarachary
>            Priority: Critical
>             Fix For: 1.3.5
>
>         Attachments: ode1.x-663-v1.txt
>
>
> The DOMUtils.cloneNode code doesn't handle default namespace declarations 
> correctly when processing an XQuery result from Saxon.
> For example:
> <ns1:parent xmlns:ns1="abc">
>    <ns1:child xmlns="def">
>       <ns2:nestedChild xmlns:ns2="def"/>
>    </ns1:child>
> </ns1:parent>
> results in:
> <ns1:parent xmlns:ns1="abc">
>    <ns1:child xmlns:xmlns="def">
>       <ns2:nestedChild xmlns:ns2="def"/>
>    </ns1:child>
> </ns1:parent>
> Notice that the default namespace has been rewritten as xmlns:xmlns which is 
> invalid. 
> Granted the above example is a bit odd, but strange things can happen when 
> passing nodes in and out of XSLT and XQuery with respect to namespace 
> declarations.

-- 
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