diff --git a/content/templates.xqm b/content/templates.xqm index f3fe689..e284161 100644 --- a/content/templates.xqm +++ b/content/templates.xqm @@ -358,6 +358,8 @@ declare %private function templates:cast($values as item()*, $targetType as xs:s xs:dateTime($value) case "xs:time" return xs:time($value) + case "xs:boolean" return + xs:boolean($value) case "element()" return parse-xml($value)/* case "text()" return diff --git a/gulpfile.js b/gulpfile.js index 393062c..3b776b2 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -31,7 +31,7 @@ const existClient = createClient(connectionOptions); const static = [ "content/*", - "test/xqs/*{.xq,.xql}" + "test/xqs/*{.xq,.xqm}" ] // test application metadata diff --git a/test/app/modules/view.xql b/test/app/modules/view.xql index 380f6d3..7140182 100644 --- a/test/app/modules/view.xql +++ b/test/app/modules/view.xql @@ -98,6 +98,15 @@ function test:date($node as node(), $model as map(*), $date as xs:date) { day-from-date($date) }; +declare + %templates:wrap +function test:boolean($node as node(), $model as map(*), $boolean as xs:boolean) { + if ($boolean instance of xs:boolean) then + "yes" + else + "no" +}; + declare function test:custom-model($node as node(), $model as map(*)) { $model?('my-model-item') }; diff --git a/test/app/types-fail.html b/test/app/types-fail.html index f50a724..9a06044 100644 --- a/test/app/types-fail.html +++ b/test/app/types-fail.html @@ -5,5 +5,6 @@
+