From 99a384ab737bcb19e65bf23109ecb67452ace9e6 Mon Sep 17 00:00:00 2001 From: Joe Wicentowski Date: Tue, 23 Jul 2019 11:36:50 -0400 Subject: [PATCH] Fix map constructor syntax See eXist-db/exist#2887. --- examples/contacts/contacts.xql | 20 ++++++++++---------- examples/templating/examples.xql | 2 +- examples/templating/restxq-demo.xql | 2 +- examples/web/guess-templates.xql | 2 +- modules/view.xql | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/examples/contacts/contacts.xql b/examples/contacts/contacts.xql index 260bc13..ccc794b 100644 --- a/examples/contacts/contacts.xql +++ b/examples/contacts/contacts.xql @@ -45,19 +45,19 @@ declare variable $contacts:HTTP-SERVER-FAIL as xs:integer := 500; (: server side (: map client side exception to http code :) declare variable $contacts:CLIENT-EXCEPTION-MAP := map { - 'ResourceNotFound' := $contacts:HTTP-NOT-FOUND, - 'ExternalResourceNotFound' := $contacts:HTTP-NOT-FOUND, - 'InvalidJson' := $contacts:HTTP-CLIENT-FAIL, - 'InvalidModel' := $contacts:HTTP-CLIENT-FAIL, - 'MissingProperty' := $contacts:HTTP-CLIENT-FAIL, - '*' := $contacts:HTTP-CLIENT-FAIL + 'ResourceNotFound': $contacts:HTTP-NOT-FOUND, + 'ExternalResourceNotFound': $contacts:HTTP-NOT-FOUND, + 'InvalidJson': $contacts:HTTP-CLIENT-FAIL, + 'InvalidModel': $contacts:HTTP-CLIENT-FAIL, + 'MissingProperty': $contacts:HTTP-CLIENT-FAIL, + '*': $contacts:HTTP-CLIENT-FAIL }; (: map server side exception to http code :) declare variable $contacts:SERVER-EXCEPTION-MAP := map { - 'DatabaseFail' := $contacts:HTTP-SERVER-FAIL, - '*' := $contacts:HTTP-SERVER-FAIL + 'DatabaseFail': $contacts:HTTP-SERVER-FAIL, + '*': $contacts:HTTP-SERVER-FAIL }; @@ -132,8 +132,8 @@ declare %private function contacts:skip-take-range($skip as xs:integer, $take as { map { - 'from' := $skip + 1, - 'to' := $skip + $take + 'from': $skip + 1, + 'to': $skip + $take } }; diff --git a/examples/templating/examples.xql b/examples/templating/examples.xql index beee963..d7c4fbc 100644 --- a/examples/templating/examples.xql +++ b/examples/templating/examples.xql @@ -49,7 +49,7 @@ function ex:hello-world($node as node(), $model as map(*), $language as xs:strin declare %templates:wrap function ex:addresses($node as node(), $model as map(*)) as map(*) { - map { "addresses" := collection($config:app-root || "/data/addresses")/address } + map { "addresses": collection($config:app-root || "/data/addresses")/address } }; declare diff --git a/examples/templating/restxq-demo.xql b/examples/templating/restxq-demo.xql index 54e9490..00bc2fd 100644 --- a/examples/templating/restxq-demo.xql +++ b/examples/templating/restxq-demo.xql @@ -21,7 +21,7 @@ function demo:page() { let $content := doc("restxq-page.html") let $config := map { (: The following function will be called to look up template parameters :) - $templates:CONFIG_PARAM_RESOLVER := function($param as xs:string) as xs:string* { + $templates:CONFIG_PARAM_RESOLVER : function($param as xs:string) as xs:string* { req:parameter($param) } } diff --git a/examples/web/guess-templates.xql b/examples/web/guess-templates.xql index 5872014..fb94cb4 100644 --- a/examples/web/guess-templates.xql +++ b/examples/web/guess-templates.xql @@ -18,7 +18,7 @@ declare function guess:init($node as node(), $model as map(*)) as map(*){ else guess:random(100) return - map { "random" := $rand } + map { "random": $rand } }; (:~ diff --git a/modules/view.xql b/modules/view.xql index e274654..d67ba68 100644 --- a/modules/view.xql +++ b/modules/view.xql @@ -20,7 +20,7 @@ declare option output:method "xhtml"; declare option output:media-type "text/html"; let $config := map { - $templates:CONFIG_APP_ROOT := $config:app-root + $templates:CONFIG_APP_ROOT : $config:app-root } let $lookup := function($functionName as xs:string, $arity as xs:int) { try {