Skip to content

Commit d6d61ad

Browse files
committed
[enhancement] XQSuite add two additional XDM types
Allow xs:NCName and xs:QName to be used as test function input and output.
1 parent ea741cb commit d6d61ad

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

exist-core/src/main/resources/org/exist/xquery/lib/xqsuite/xqsuite.xql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,9 @@ declare %private function test:cast(
611611
case "xs:boolean" return xs:boolean($literal-value)
612612
case "xs:anyURI" return xs:anyURI($literal-value)
613613

614+
case "xs:NCName" return xs:NCName($literal-value)
615+
case "xs:QName" return xs:QName($literal-value)
616+
614617
case "xs:numeric" return xs:numeric($literal-value)
615618
case "xs:int" return xs:int($literal-value)
616619
case "xs:positiveInteger" return xs:positiveInteger($literal-value)
@@ -1001,6 +1004,9 @@ declare %private function test:cast-to-type($value as item(), $result as item())
10011004

10021005
case xs:anyURI return xs:anyURI($value)
10031006

1007+
case xs:NCName return xs:NCName($value)
1008+
case xs:QName return xs:QName($value)
1009+
10041010
default return string($value)
10051011
};
10061012

exist-core/src/test/xquery/xqsuite/xqsuite-tests.xql

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,20 @@ function t:args-assert-anyURI($arg as xs:anyURI) as xs:anyURI {
148148
$arg
149149
};
150150

151+
declare
152+
%test:args("asdf")
153+
%test:assertEquals("asdf")
154+
function t:args-assert-ncname($arg as xs:NCName) as xs:NCName {
155+
$arg
156+
};
157+
158+
declare
159+
%test:args("test:asdf")
160+
%test:assertEquals("test:asdf")
161+
function t:args-assert-qname($arg as xs:QName) as xs:QName {
162+
$arg
163+
};
164+
151165
declare
152166
%test:args("2001-01-01")
153167
%test:assertEquals("2001-01-01")

0 commit comments

Comments
 (0)