Skip to content

Commit 09fca40

Browse files
committed
Fixes for eXist-db 5.0.0
1 parent 1c07003 commit 09fca40

File tree

3 files changed

+4
-27
lines changed

3 files changed

+4
-27
lines changed

src/main/xar-resources/modules/collection.xqm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ declare function col:copy($src-uri as xs:string, $dst-uri as xs:string) as xs:st
5959
let $dst-name := $_[2]
6060
return
6161
if ($src-name eq $dst-name) then
62-
let $_ := xmldb:copy($src-uri, $dst-parent)
62+
let $_ := xmldb:copy-collection($src-uri, $dst-parent)
6363
return
6464
$dst-uri
6565
else
6666

6767
(: copy to a temp collection :)
6868
let $temp-id := util:uuid()
6969
let $temp-col-uri := ut:mkcol("/db/" || $temp-id)
70-
let $_ := xmldb:copy($src-uri, $temp-col-uri)
70+
let $_ := xmldb:copy-collection($src-uri, $temp-col-uri)
7171

7272
(: rename the collection to its destination name:)
7373
let $_ := xmldb:rename($temp-col-uri || "/" || $src-name, $dst-name)

src/main/xar-resources/modules/document.xqm

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -134,30 +134,7 @@ declare function doc:copy($src-uri as xs:string, $dst-uri as xs:string) as xs:st
134134
let $dst-parent := $_[1]
135135
let $dst-name := $_[2]
136136
return
137-
138-
if ($src-name eq $dst-name) then
139-
let $_ := xmldb:copy($src-parent, $dst-parent, $src-name)
140-
return
141-
$dst-uri
142-
else
143-
144-
(: copy to a temp collection :)
145-
let $temp-id := util:uuid()
146-
let $temp-col-uri := ut:mkcol("/db/" || $temp-id)
147-
let $_ := xmldb:copy($src-parent, $temp-col-uri, $src-name)
148-
149-
(: rename the document to its destination name:)
150-
let $_ := xmldb:rename($temp-col-uri, $src-name, $dst-name)
151-
return
152-
153-
(: move the renamed document into place :)
154-
let $_ := xmldb:move($temp-col-uri, $dst-parent, $dst-name)
155-
156-
(: remove the temp collection :)
157-
let $_ := xmldb:remove($temp-col-uri)
158-
return
159-
160-
$dst-uri
137+
xmldb:copy-resource($src-parent, $src-name, $dst-parent, $dst-name)
161138

162139
else
163140
perr:error($perr:PD003, $src-uri)

src/main/xar-resources/modules/json-xml.xqm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ declare %private function jx:json-to-xml-recurse($json as item()*) as item()+ {
8686
$array-member
8787
}
8888
else if ($data-type eq "map") then
89-
map:for-each-entry(
89+
map:for-each(
9090
$json,
9191
function($object-name, $object-value) {
9292
let $object-value-data-type := jx:json-data-type($object-value)

0 commit comments

Comments
 (0)