Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mem-op namespace is output #17

Open
tademianhess opened this issue Apr 7, 2017 · 1 comment
Open

mem-op namespace is output #17

tademianhess opened this issue Apr 7, 2017 · 1 comment

Comments

@tademianhess
Copy link

It looks like this was partially fixed in 2014 with commit 0b3a72d, but I am still getting the mem-op namespace included in output if I call insert-child on the same element used for in mem:copy()

Example shows the problem:

xquery version "1.0-ml";
import module namespace mem = "http://maxdewpoint.blogspot.com/memory-operations/functional" 
   at "memory-operations-functional.xqy";
let $x := <root><original-container><one/><two/><three/><four/><five/></original-container><new-container/></root> 
return mem:execute( mem:insert-child(mem:copy($x), $x, <foo/>) )
===>
<root xmlns:mem-op="http://maxdewpoint.blogspot.com/memory-operations"><original-container><one/><two/><three/><four/><five/></original-container><new-container/><foo/></root>

This example avoids the problem (inserting into original-container and not root):

xquery version "1.0-ml";
import module namespace mem = "http://maxdewpoint.blogspot.com/memory-operations/functional" 
   at "memory-operations-functional.xqy";
let $x := <root><original-container><one/><two/><three/><four/><five/></original-container><new-container/></root> 
let $oc := $x/original-container
return mem:execute( mem:insert-child(mem:copy($x), $oc, <foo/>) )
===>
<root><original-container><one/><two/><three/><four/><five/><foo/></original-container><new-container/></root>
@benibela
Copy link

It might help to add

declare copy-namespaces no-preserve, no-inherit; 

in the module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants