Permalink
Browse files

mappings for user-name and modules-name

  • Loading branch information...
1 parent 08a55cb commit ef604c31c28b14af8390b4eb2a293ed510f88559 @mblakele committed Jun 1, 2012
Showing with 18 additions and 4 deletions.
  1. +5 −2 README.md
  2. +4 −0 src/lib-xqut.xqy
  3. +2 −1 src/xqut.xsd
  4. +7 −1 test/test.xml
View
@@ -77,8 +77,11 @@ to `xdmp:eval`.
* `user-id`
* `root`
-The attribute `database-name` is resolved to a database id, and then
-treated as if the `database` option were set.
+Certain attributes will be translated automatically from names to ids.
+
+* `database-name` to `database`
+* `modules-name` to `modules`
+* `user-name` to `user-id`
Besides these `xdmp:eval` options, each environment element may
include any number of library module imports. Each `import` element
View
@@ -87,6 +87,10 @@ as map:map
return typeswitch($a)
case attribute(database-name) return map:put(
$new, 'database', xdmp:database($a))
+ case attribute(modules-name) return map:put(
+ $new, 'modules', xdmp:database($a))
+ case attribute(user-name) return map:put(
+ $new, 'user-id', xdmp:user($a))
default return (
let $k := local-name($a)
return (
View
@@ -18,9 +18,10 @@
: affiliated with the Apache Software Foundation.
-->
<xs:schema
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
targetNamespace="com.blakeley.xqut"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:t="com.blakeley.xqut">
<xs:element name="suite">
View
@@ -49,7 +49,7 @@
&lt;/options>)
</setup>
- <unit result="" note="parse test">''</unit>
+ <unit fatal="true" note="parse test">()</unit>
<unit result="-1" note="this test should fail">xdmp:random(10)</unit>
@@ -132,6 +132,12 @@
</expr>
</unit>
+ <unit note="unit-level user-name=nobody">
+ <environment user-name="nobody"/>
+ <expr>xdmp:get-current-user()</expr>
+ <result>nobody</result>
+ </unit>
+
<teardown>xdmp:elapsed-time()</teardown>
</suite>

0 comments on commit ef604c3

Please sign in to comment.