Tests types of variables are set correctly (Part 1)
Test ab-xquery-036.xml is expected to pass.
It requires the following features: xquery_3_1.
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="3.0">
<p:output port="result"/>
<p:xquery version="3.1" parameters="map{'variable' : (xs:untypedAtomic('untyped'), xs:dateTime('2006-05-03T13:20:00'), xs:date('2006-05-03'), xs:time('13:30:00'), xs:yearMonthDuration('P3Y5M'), xs:dayTimeDuration('P2DT3H'), xs:float('3.0'), xs:double('42.42'), xs:decimal('42'), xs:gYearMonth('2026-06'), xs:gYear('2025'), xs:gMonthDay('--05-03'), xs:gDay('---04'), xs:gMonth('--06 '), xs:boolean('false'), xs:base64Binary('0CD7'), xs:hexBinary('0CD7'), xs:anyURI('http://test'), QName('http://test', 'name'))}">
<p:with-input port="source">
<p:empty/>
</p:with-input>
<p:with-input port="query" xml:base="http://xquery-uri">
<p:inline content-type="text/plain">
declare namespace xs ="http://www.w3.org/2001/XMLSchema";
declare variable $variable external;
<tests>
<untyped-test>{{$variable[1] instance of xs:untypedAtomic}}</untyped-test>
<dateTime-test>{{$variable[2] instance of xs:dateTime}}</dateTime-test>
<date-test>{{$variable[3] instance of xs:date}}</date-test>
<time-test>{{$variable[4] instance of xs:time}}</time-test>
<year-month-duration-test>{{$variable[5] instance of xs:yearMonthDuration}}</year-month-duration-test>
<day-time-duration-test>{{$variable[6] instance of xs:dayTimeDuration}}</day-time-duration-test>
<float-test>{{$variable[7] instance of xs:float}}</float-test>
<double-test>{{$variable[8] instance of xs:double}}</double-test>
<decimal-test>{{$variable[9] instance of xs:decimal}}</decimal-test>
<gyear-month-test>{{$variable[10] instance of xs:gYearMonth}}</gyear-month-test>
<gyear-test>{{$variable[11] instance of xs:gYear}}</gyear-test>
<gmonth-day-test>{{$variable[12] instance of xs:gMonthDay}}</gmonth-day-test>
<gday-test>{{$variable[13] instance of xs:gDay}}</gday-test>
<gmonth-test>{{$variable[14] instance of xs:gMonth}}</gmonth-test>
<boolean-test>{{$variable[15] instance of xs:boolean}}</boolean-test>
<base64-test>{{$variable[16] instance of xs:base64Binary}}</base64-test>
<hex-test>{{$variable[17] instance of xs:hexBinary}}</hex-test>
<anyURI-test>{{$variable[18] instance of xs:anyURI}}</anyURI-test>
<qname-test>{{$variable[19] instance of xs:QName}}</qname-test>
</tests>
</p:inline>
</p:with-input>
</p:xquery>
</p:declare-step>
<s:schema xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
<s:pattern>
<s:rule context="/">
<s:assert test="tests">Root element is not 'tests'.</s:assert>
<s:assert test="tests/untyped-test/text()='true'">$variable[1] is not xs:untypedAtomic.</s:assert>
<s:assert test="tests/dateTime-test/text()='true'">$variable[2] is not xs:dateTime.</s:assert>
<s:assert test="tests/date-test/text()='true'">$variable[3] is not xs:date.</s:assert>
<s:assert test="tests/time-test/text()='true'">$variable[4] is not xs:time.</s:assert>
<s:assert test="tests/year-month-duration-test/text()='true'">$variable[5] is not xs:yearMonthDuration.</s:assert>
<s:assert test="tests/day-time-duration-test/text()='true'">$variable[6] is not xs:dayTimeDuration.</s:assert>
<s:assert test="tests/float-test/text()='true'">$variable[7] is not xs:float</s:assert>
<s:assert test="tests/double-test/text()='true'">$variable[8] is not xs:double</s:assert>
<s:assert test="tests/decimal-test/text()='true'">$variable[9] is not xs:decimal</s:assert>
<s:assert test="tests/gyear-month-test/text()='true'">$variable[10] is not xs:gYearMonth</s:assert>
<s:assert test="tests/gyear-test/text()='true'">$variable[11] is not xs:gYear</s:assert>
<s:assert test="tests/gmonth-day-test/text()='true'">$variable[12] is not xs:gMonthDay</s:assert>
<s:assert test="tests/gday-test/text()='true'">$variable[13] is not xs:gDay</s:assert>
<s:assert test="tests/gmonth-test/text()='true'">$variable[14] is not xs:gMonth</s:assert>
<s:assert test="tests/boolean-test/text()='true'">$variable[15] is not xs:boolean</s:assert>
<s:assert test="tests/base64-test/text()='true'">$variable[16] is not xs:base64Binary</s:assert>
<s:assert test="tests/hex-test/text()='true'">$variable[17] is not xs:hexBinary</s:assert>
<s:assert test="tests/anyURI-test/text()='true'">$variable[18] is not xs:anyURI</s:assert>
<s:assert test="tests/qname-test/text()='true'">$variable[19] is not xs:QName</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Initial commit