Hi Hans-Jürgen,

The insertion of namespace nodes has not been defined in the XQuery Update 
spec. You may need choose the classic element constructor for that:

let $doc := <doc><a/></doc>
return element { node-name($doc) } {
  $doc/@*,
  namespace xyz { 'https://basex.org/ns' },
  $doc/node()
}

Hope this helps,
Christian
________________________________
Von: Hans-Juergen Rennau via BaseX-Talk <[email protected]>
Gesendet: Samstag, 2. August 2025 15:51
An: BaseX <[email protected]>
Betreff: [basex-talk] Add namespace bindings via copy/modify/return

Dear BaseX people,

I cannot use copy/modify/return in order to add a namespacing:

let $doc := <doc><a/></doc>
return
    copy $doc_ := $doc
    modify
      insert node namespace xyz {'https://basex.org/ns'} into $doc_
    return $doc_

=>
<doc>
  <a/>
</doc>

Is this a bug?

Kind regards,
Hans-Jürgen

Reply via email to