Schema document for namespace http://www.w3.org/2010/09/qt-fots-catalog



Import http://www.w3.org/XML/1998/namespace

Formal declaration in XSD source form

    <xs:import
      namespace="http://www.w3.org/XML/1998/namespace"
      schemaLocation="xml.xsd"
      xml:lang="en"/>

Annotation

QT3 Test Suite Schema

This schema documentation describes the elements and attributes which are to be used in the catalog and test-set instance documents, and belong to the QT3 test suite (known during development as FOTS).

QT3 derives from the W3C XQuery and XSLT test suites, where we intend to overcome the following problems with the existing test suites:

This schema describes two kinds of file: the master catalog file, rooted at a catalog element, and test-set files, which are rooted at a test-set element. The catalog file contains a sequence of test-set elements which are references to the test-set files.

Element catalog

catalog

Denotes the root element of the catalog document. The catalog lists all test-sets that are to be run and also contains an environment of assorted schemas and source documents.

Formal declaration in XSD source form

    
    <xs:element name="catalog">
        
        
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="environment" minOccurs="1" maxOccurs="unbounded"/>
                <xs:element name="test-set" maxOccurs="unbounded">                    
                    <xs:complexType>
                        <xs:complexContent>
                            <xs:extension base="baseType">
                                <xs:attributeGroup ref="nameAttr"/>
                                <xs:attributeGroup ref="fileAttr"/>
                             </xs:extension>
                        </xs:complexContent>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
            <xs:attribute name="version" type="xs:decimal">
                
            </xs:attribute>    
            <xs:attribute name="test-suite" type="xs:string">
               
            </xs:attribute>                     
        </xs:complexType>
    </xs:element>

Element environment

environment

Denotes an element which defines an assorted list of schemas and sources documents available to test cases. For definition of schemas the test drivers should assume a dependency on schema-awareness.

In addition the environment may set further information about the static context for running the test.

An environment can be made globally available across all test-sets, or within a particular test-set or within a test-case. Locally-defined environments are considered to have precedence over environments defined at some ancestor node, therefore conflicts are avoided.

An environment that is shared between test cases always has a name (given by its name attribute). An environment element within a test case may either be a reference to a shared environment (identified by its ref attribute) or a locally-defined environment (with no name or ref attributes.

Formal declaration in XSD source form

    
    <xs:element name="environment">
        
        <xs:complexType>
            <xs:complexContent>
                <xs:extension base="baseType">            
                    <xs:choice minOccurs="0" maxOccurs="unbounded">
                        <xs:element ref="schema"/>
                        <xs:element ref="source"/>
                        <xs:element ref="resource"/>
                        <xs:element ref="param"/>
                        <xs:element ref="context-item"/>
                        <xs:element ref="decimal-format"/>
                        <xs:element ref="namespace"/>
                        <xs:element ref="function-library"/>
                        <xs:element ref="collection"/>
                        <xs:element ref="static-base-uri"/>
                        <xs:element ref="collation"/>
                    </xs:choice>
                    <xs:attributeGroup ref="nameAttr"/>
                    <xs:attributeGroup ref="refAttr"/>
                </xs:extension>
            </xs:complexContent>
        </xs:complexType>
    </xs:element>

Element static-base-uri

static-base-uri

An element used to supply the static base URI for a query. The uri attribute should be an absolute URI.

In the absence of this element, or of a base URI declaration in the query prolog, the static base URI of a query is the file containing the text of the query.

The value uri='#UNDEFINED' indicates that the test expects the static base URI to be absent.

Formal declaration in XSD source form

    
    <xs:element name="static-base-uri">
        
        <xs:complexType>
            <xs:attributeGroup ref="uriAttr"/>
        </xs:complexType>
    </xs:element>

Element collation

collation

An element which defines a collation URI used in the query.

The uri attribute is the collation URI as it actually appears in the XPath expression. There is a small enumerated set of collation URIs that may appear in tests; these have a meaning that is defined in the test suite. In addition, from 3.1 onwards, URIs in the Unicode Collation Algorithm family can be used. If the implementation cannot bind arbitrary URIs to collations, it may substitute this URI in the source expression by a different one having the same semantics. If the implementation does not support the semantics of the collation, then it should not run the test (support for collations other than the codepoint collation is not a conformance requirement.

The default attribute indicates whether this collation is to be used as the default collation.

Formal declaration in XSD source form

    
    <xs:element name="collation">
        
        <xs:complexType>
            <xs:attribute name="uri">
             <xs:simpleType>
              <xs:union> 
                <xs:simpleType>
                    <xs:restriction base="xs:anyURI">
                        <xs:enumeration value="http://www.w3.org/2005/xpath-functions/collation/codepoint">
                            
                        </xs:enumeration>
                        <xs:enumeration value="http://www.w3.org/2010/09/qt-fots-catalog/collation/caseblind">
                            
                        </xs:enumeration>
                        <xs:enumeration
      value="http://www.w3.org/2005/xpath-functions/collation/html-ascii-case-insensitive">
                            
                        </xs:enumeration>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType>
                  <xs:restriction base="xs:anyURI">
                    <xs:pattern value="http://www.w3.org/2013/collation/UCA\?.*"/>
                  </xs:restriction>
                </xs:simpleType>
               </xs:union>
              </xs:simpleType>   
             </xs:attribute>
             <xs:attribute name="default" type="xs:boolean" use="optional" default="false">
                
             </xs:attribute>
        </xs:complexType>
    </xs:element>

Element decimal-format

decimal-format

The decimal-format element allows a decimal format to be defined as part of the static context for evaluating an XPath expression that calls the format-number() function.

When the decimal-format element is used in an environment, the test expression will always be a simple XPath expression. If the test is to be run using an XQuery processor, the decimal format can be added to the static context either by using the processor's API, or by constructing a query prolog containing a declare decimal format declaration and prepending this to the test expression.

The mechanism is used for testing the format-number() function. As such, the decimal format being defined should always be valid. Tests for invalid decimal formats should be written as XQuery tests with an explicit query prolog (or the equivalent in XSLT).

Test Catalog006 ensures that the decimal-format element is only used in tests that are pure XPath expressions.

Formal declaration in XSD source form

    
    <xs:element name="decimal-format">
        
        <xs:complexType>
            <xs:attribute name="name" type="xs:QName"/>
            <xs:attribute name="decimal-separator" type="one-char"/>
            <xs:attribute name="grouping-separator" type="one-char"/>
            <xs:attribute name="zero-digit" type="one-char"/> 
            <xs:attribute name="digit" type="one-char"/>
            <xs:attribute name="minus-sign" type="one-char"/> 
            <xs:attribute name="percent" type="one-char"/>
            <xs:attribute name="per-mille" type="one-char"/>
            <xs:attribute name="pattern-separator" type="one-char"/>
            <xs:attribute name="exponent-separator" type="one-char"/>
            <xs:attribute name="infinity" type="xs:string"/>
            <xs:attribute name="NaN" type="xs:string"/>
        </xs:complexType>
    </xs:element>

Simple type one-char

Notes

A simple type representing a string whose length is exactly one character.

Formal declaration in XSD source form

    
    <xs:simpleType name="one-char">
        
        <xs:restriction base="xs:string">
            <xs:pattern value="."/>
        </xs:restriction>
    </xs:simpleType>

Element param

param

An element within an environment that declares a variable that can be referenced within test expressions that use this environment.

The value to be bound to the variable is given in the select attribute, which should be a simple XPath expression - typically a literal, or a simple call on a constructor function.

The test expression may or may not include a declaration of the variable (so it can be executed if appropriate using XPath). The "declared" attribute will be present with the value "true" if the variable is declared in the query prolog. The test driver can add a declaration of the variable to the query prolog if required. If the test expression includes the string "(:%VARDECL%:)" then the variable declaration should be added to replace this string; if it does not include this string, the variable declaration can be added at the start.

Formal declaration in XSD source form

               
    
    <xs:element name="param">
        
        <xs:complexType>
            <xs:attribute name="name" type="xs:QName" use="required"/>
            <xs:attribute name="select" type="xs:string" use="optional"/>
            <xs:attribute name="as" type="xs:string" use="optional"/>
            <xs:attribute name="source" type="xs:string" use="optional"/>
            <xs:attribute name="declared" type="xs:boolean" use="optional" default="false"/>
        </xs:complexType>
    </xs:element>

Element context-item

context-item

An element within an environment that declares the value of the context item for a query.

The value to be bound to the variable is given in the select attribute, which should be a simple XPath expression - typically a literal, or a simple call on a constructor function.

The query is called with the value of the select expression as the context item.

Formal declaration in XSD source form

    
    <xs:element name="context-item">
        
        <xs:complexType>
            <xs:attribute name="select" type="xs:string" use="optional"/>
        </xs:complexType>
    </xs:element>

Element collection

collection

Represents a collection accessible to the collection() function.

The uri attribute identifies the collection URI. If this is absent or zero-length, the collection acts as the default collection, used when no URI is supplied to the collection() function.

The contained source elements identify the documents making up the collection.

Formal declaration in XSD source form

    
    <xs:element name="collection">
        
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="source" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="resource" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="query" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
            <xs:attributeGroup ref="uriAttr"/>
        </xs:complexType>
    </xs:element>

Element function-library

function-library

An element which provides access to a function library defined for xslt and xquery.

Formal declaration in XSD source form

       
    <xs:element name="function-library">
        
        <xs:complexType>
            <xs:attributeGroup ref="nameAttr"/>
            <xs:attribute name="xslt-location"/>
            <xs:attribute name="xquery-location"/>
        </xs:complexType>
    </xs:element>

Element namespace

namespace

When this element is present in an environment, queries using this environment must have a namespace binding in the static context that binds the specified prefix to the specified namespace URI.

A zero-length prefix denotes the default namespace for elements and types.

All tests using an environment that contains a namespace element will be simple XPath expressions, so that the test can be run either under XPath or XQuery. If the test is run using an XPath processor, the namespace must be declared externally using the processor's API. If it is run using an XQuery processor, the namespace can either be declared externally using the processor's API, or a "declare namespace" declaration can be added to the query prolog. Because the test is guaranteed to be a simple XPath expression, adding the namespace declaration at the start is straightforward.

Test Catalog005 checks that no test that requires XQuery uses an environment that contains a namespace element.

Formal declaration in XSD source form

    
    <xs:element name="namespace">
        
        <xs:complexType>
            <xs:attribute name="prefix"/>
            <xs:attribute name="uri"/>
        </xs:complexType>
    </xs:element>

Element query

query

The content of the element is an XQuery expression to be evaluated. This should return a sequence equivalent to the contents of a sequence which can used as input to test cases. Specifically used in fn:collection. The scope of the <query> element is the parent <collection> element in which it appears.

For example: unparsed-text-lines('xxx')!parse-json()

Formal declaration in XSD source form


     <xs:element name="query">
        

    </xs:element>

Element schema

schema

An element which provides information about a schema to be used to validate a source document. The scope of the <schema> element is the parent <environment> element in which it appears. The test drivers should assume a dependency on schema-awareness.

Formal declaration in XSD source form

    
    <xs:element name="schema" type="schemaType">
    
    </xs:element>

Complex type baseType

Formal declaration in XSD source form

    
    <xs:complexType name="baseType" abstract="true">
        <xs:attribute ref="xml:id"/>
    </xs:complexType>

Complex type schemaType

schemaType

The type definition for the schema element

Formal declaration in XSD source form

    
    <xs:complexType name="schemaType">
        
        <xs:complexContent>
            <xs:extension base="baseType">
                <xs:sequence>
                    <xs:element ref="description" minOccurs="0" maxOccurs="1"/>
                    <xs:element ref="created" minOccurs="0" maxOccurs="1"/>
                    <xs:element ref="modified" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
                <xs:attributeGroup ref="uriAttr"/>
                <xs:attributeGroup ref="fileAttr"/>
                <xs:attribute name="xsd-version" type="xs:decimal" default="1.0"/>
                <xs:attributeGroup ref="roleAttr"/>
                
            </xs:extension>
            
        </xs:complexContent>
        
    </xs:complexType>

Element source

source

An element which provides information about a source xml file used as input to test cases.

The role and uri attributes indicate how the source document is made available to queries (as the context item, as the value of an external variable, or as a URI that can be supplied to the doc() function.)

The file attribute gives the relative location of the file containing the XML source.

The scope of the <source> element is the parent <environment> element in which it appears. A validated source document references the schema, which maps to the @id of the Schema element.

Formal declaration in XSD source form

    
    <xs:element name="source" type="sourceType">
        
        
    </xs:element>

Complex type sourceType

sourceType

defines the type of the source element.

Formal declaration in XSD source form

    
    <xs:complexType name="sourceType">
        
        <xs:complexContent>
            <xs:extension base="baseType">
                <xs:sequence>
                    <xs:element ref="description" minOccurs="0" maxOccurs="1"/>
                    <xs:element ref="created" minOccurs="0" maxOccurs="1"/>
                    <xs:element ref="modified" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
                <xs:attributeGroup ref="roleAttr"/>
                <xs:attributeGroup ref="fileAttr"/>
                <xs:attributeGroup ref="uriAttr"/>
                <xs:attributeGroup ref="validationAttr"/>
           
            </xs:extension>
        </xs:complexContent>
        
    </xs:complexType>

Element resource

resource

An element which provides information about a file that can be read as text, used as input to test cases.

The uri attributes indicate how the resource is made available to queries (as a URI that can be supplied to the unparsed-text(), unparsed-text-lines() and unparsed-text-available() functions.)

The file attribute gives the relative location of the file containing the resource.

The optional media-type attribute gives the media type of the resource.

The optional encoding attribute gives the name of the encoding of the resource.

The scope of the <resource> element is the parent <environment> element in which it appears. A validated source document references the schema, which maps to the @id of the Schema element.

Formal declaration in XSD source form

    
    <xs:element name="resource" type="resourceType">
        
        
    </xs:element>

Complex type resourceType

resourceType

defines the type of the resource element.

Formal declaration in XSD source form

    
    <xs:complexType name="resourceType">
        
        <xs:complexContent>
            <xs:extension base="baseType">
                <xs:sequence>
                    <xs:sequence>
                    <xs:element ref="description" minOccurs="0" maxOccurs="1"/>
                    <xs:element ref="created" minOccurs="0" maxOccurs="1"/>
                    <xs:element ref="modified" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
                </xs:sequence>
                <xs:attributeGroup ref="fileAttr"/>
                <xs:attributeGroup ref="uriAttr"/>
                <xs:attributeGroup ref="media-typeAttr"/>
                <xs:attributeGroup ref="encodingAttr"/>
           
            </xs:extension>
        </xs:complexContent>
        
    </xs:complexType>

Element description

description

An element which provides descriptive information about the resource described by its parent element.

Formal declaration in XSD source form

    
    
    <xs:element name="description">
        
        
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="xs:string">
                                        
                </xs:extension>
                
            </xs:simpleContent>
            
            
        </xs:complexType>
    </xs:element>

Element test-set

test-set

denotes an element which provides a sequence of test-case entries for a particular function. Within this element we provide data needed to run the test for that function.

Formal declaration in XSD source form

    
    <xs:element name="test-set">
        
        <xs:complexType>
            <xs:sequence>
                <xs:choice maxOccurs="unbounded">
                    <xs:element ref="description"/>
                    <xs:element ref="link"/>
                    <xs:element ref="environment"/>
                    <xs:element ref="dependency"/>
                </xs:choice>
                <xs:element ref="test-case" maxOccurs="unbounded"/>
            </xs:sequence>
            <xs:attributeGroup ref="nameAttr"/>
            <xs:attributeGroup ref="coversAttr"/>
            <xs:attributeGroup ref="covers30Attr"/>
        </xs:complexType>
    </xs:element>

Element dependency

dependency

Indicates a dependency which must be satisfied in order for a test to be run.

A dependency may be associated with an individual test case or with a test-set. A dependency at the level of a test-set appplies to all test cases in that test-set.

The attribute setting satisfied="false" indicates that the test should only be run if the dependency is NOT satisfied.

The set of recognized values appearing in the value attribute depends on the content of the type attribute.

The most commonly-used dependency is on the version of XPath or XQuery. This is represented by a dependency with type="spec" whose corresponding value is, for example value="XQ10+ XP30+" which indicates that the test can be run with XQuery 1.0 or later, or XPath 3.0 or later. A test with value="XQ10" should be run with an XQuery 1.0 processor only (typically, an XQuery 3.0 processor will produce a different result, described in a separate test case.)

Formal declaration in XSD source form

    
    <xs:element name="dependency">
        
        <xs:complexType>
            <xs:attributeGroup ref="typeAttr"/>
            <xs:attributeGroup ref="valueAttr"/>
            <xs:attribute name="satisfied" type="xs:boolean" default="true">
                
            </xs:attribute>
        </xs:complexType>
    </xs:element>

Element test-case

test-case

denotes an element that contains a test that must be run in a named environment, also contains the expected result and description of the test, including author and creation date.

Formal declaration in XSD source form

    
    <xs:element name="test-case">
        
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="description"/>
                <xs:element ref="created"/>
                <xs:element ref="modified" minOccurs="0" maxOccurs="unbounded"/>
                <xs:choice minOccurs="0" maxOccurs="unbounded">
                  <xs:element ref="environment"/> 
                  <xs:element ref="module"/>
                  <xs:element ref="dependency"/>
                </xs:choice>  
                <xs:element ref="test"/>
                <xs:element ref="result"/>
            </xs:sequence>
            <xs:attributeGroup ref="nameAttr"/>
            <xs:attributeGroup ref="coversAttr"/>
            <xs:attributeGroup ref="covers30Attr"/>
        </xs:complexType>
    </xs:element>

Element test

test

The content of the element is an XPath or XQuery expression to be evaluated.

As an alternative to providing the content inline, it may be provided in an external file referenced using the file attribute. This is done only exceptionally, where (a) the query is unusually large, or (b) there is a need to test features that can only be achieved with an external file, for example special encodings.

Formal declaration in XSD source form

    
    <xs:element name="test">
        
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="xs:string">
                    <xs:attribute name="file" type="xs:anyURI" use="optional"/>
                </xs:extension>
            </xs:simpleContent>
        </xs:complexType>        
    </xs:element>

Element created

created

Provides details of the author and creation date of a test case, source document, schema, etc.

Formal declaration in XSD source form

    
    <xs:element name="created">
        
        <xs:complexType>
            <xs:attributeGroup ref="byAttr"/>
            <xs:attributeGroup ref="onAttr"/>
        </xs:complexType>
    </xs:element>

Element modified

modified

Provides a record of changes made to a test case or other resource over time.

Formal declaration in XSD source form

    
    <xs:element name="modified">
        
        <xs:complexType>
            <xs:attributeGroup ref="byAttr"/>
            <xs:attributeGroup ref="onAttr"/>
            <xs:attributeGroup ref="changeAttr"/>
        </xs:complexType>
    </xs:element>

Element module

module

Defines an XQuery library module imported by a test case. The module element gives the module URI and the location of the module. The query will contain an "import module" declaration referencing the same module URI, with no "at" location (except where the "at" attribute is being specifically tested, in which case the results are undefined.)

Formal declaration in XSD source form

    
    <xs:element name="module">
        
        <xs:complexType>
            <xs:attribute name="uri" type="xs:anyURI"/>
            <xs:attribute name="file" type="xs:anyURI"/>
        </xs:complexType>
    </xs:element>

Element result

result

denotes an element which provides an <assert> or >error< element pertaining the expected result. Alternatively assertions can appears as a list within <any-of> or <all-of> element. The meaning of these elements are self explantary.

Formal declaration in XSD source form

    
    <xs:element name="result">
        
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="abstractAssertion"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

Complex type SequenceOfAssertionsType

complexType for a sequence of assertions

Formal declaration in XSD source form

    
    
    <xs:complexType name="SequenceOfAssertionsType">
        
        <xs:sequence>
            <xs:element ref="abstractAssertion" minOccurs="1" maxOccurs="unbounded"/>          
        </xs:sequence>
    </xs:complexType>

Element any-of

any-of

denotes an element which provides a list of assertions. One or more of the assertions needs to prove true for the test to pass, but if all fail then the test fails.

Formal declaration in XSD source form

    
    
    <xs:element
      name="any-of"
      type="SequenceOfAssertionsType"
      substitutionGroup="abstractAssertion">
        
    </xs:element>

Element all-of

all-of

denotes an element which provides a list of assertions that must be all satisfied, if any of the assertions proves to be false then the test fails.

Formal declaration in XSD source form

    
    <xs:element
      name="all-of"
      type="SequenceOfAssertionsType"
      substitutionGroup="abstractAssertion">
        
    </xs:element>

Element not

all-of

Negates an assertion: this assertion is satisfied if the contained assertion fails, and vice versa. Particularly useful with assert-serialization-matches.

Formal declaration in XSD source form

    
    <xs:element name="not" substitutionGroup="abstractAssertion">
        
        <xs:complexType>
          <xs:sequence>
            <xs:element ref="abstractAssertion"/>         
          </xs:sequence>
        </xs:complexType>  
    </xs:element>

Element abstractAssertion

abstractAssertion

Abstract superclass for the various kinds of assertion.

Formal declaration in XSD source form

    
    <xs:element name="abstractAssertion" abstract="true" type="xs:anyType">
        
    </xs:element>

Element assert

assert

The assert element contains an XPath expression whose effective boolean value must be true; usually the expression will use the variable $result which references the result of the expression.

For example, <assert>matches(string($result), '[0-9]{3}')</assert> asserts that the result of the test expression is a three-digit number.

Formal declaration in XSD source form

    
    
    
    <xs:element name="assert" substitutionGroup="abstractAssertion">
        
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="xs:string"/>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>

Element assert-eq

assert-eq

The assert element contains an XPath expression (usually a simple string or numeric literal) which must be equal to the result of the test case under the rules of the XPath 'eq' operator.

For example, <assert-eq>12</assert-eq> asserts that the result of the test expression is an atomic value that compares equal to the integer 12 (which means it might be the double value 12.0 or the float value 12.0 or the untyped atomic value "12.0", for example).

Formal declaration in XSD source form

    
    <xs:element name="assert-eq" substitutionGroup="abstractAssertion">
        
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="xs:string"/>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>

Element assert-count

assert-count

Asserts that the result must be a sequence containing a given number of items. The value of the element is an integer giving the expected length of the sequence.

Formal declaration in XSD source form

    
    <xs:element name="assert-count" substitutionGroup="abstractAssertion">
        
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="xs:integer"/>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>

Element assert-deep-eq

assert-deep-eq

Asserts that the result must be a sequence of atomic values that is deep-equal to the supplied sequence under the rules of the deep-equal() function.

Formal declaration in XSD source form

    
    <xs:element name="assert-deep-eq" substitutionGroup="abstractAssertion">
        
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="xs:string"/>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>

Element assert-permutation

assert-permutation

Asserts that the result must be a sequence of atomic values that has some permutation (reordering) that is deep-equal to the supplied sequence under the rules of the deep-equal() function.

Note this implies that NaN is equal to NaN.

Formal declaration in XSD source form

    
    <xs:element name="assert-permutation" substitutionGroup="abstractAssertion">
        
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="xs:string"/>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>

Element assert-xml

assert-xml

Asserts the result of the query by providing a serialization of the expression result using the default serialization parameters method="xml" indent="no" omit-xml-declaration="yes".

Previously called assert-serialization. Note that this assertion is not used to test serialization; it is used as a way of supplying the expected results of the query in the form of an XML document.

The assertion is true if the result of parsing and canonicalizing the XML given in the body of the assert-xml element is the same (byte-for-byte) as the result of canonicalizing the XML result of the query. As an alternative to canonicalizing, the results may be compared using the fn:deep-equal() function.

The value will not necessarily be a well-formed document (it may be a fragment). The comparison can be done by converting the string into a well-formed document by adding a wrapper element.

Formal declaration in XSD source form

    
    <xs:element name="assert-xml" substitutionGroup="abstractAssertion">
        
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="xs:string">
                    <xs:attributeGroup ref="fileAttr"/>
                    <xs:attribute name="ignore-prefixes" type="xs:boolean">
                        
                    </xs:attribute>
                </xs:extension>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>

Element serialization-matches

serialization-matches

Asserts the result of serializing the query matches a given regular expression.

The result of the query must be serialized using the serialization options specified within the query (if any).

The assertion is true if the output of the serializer (as a string) matches the regular expression, when compared using the matches() function with the specified flags. Note this is not an anchored match, unless anchors are included within the regular expression itself.

Note that the serializer output is treated as a string; we have no way of testing the encoding of serialized output when treated as an octet stream.

Formal declaration in XSD source form

    
    <xs:element name="serialization-matches" substitutionGroup="abstractAssertion">
        
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="xs:string">
                    <xs:attributeGroup ref="fileAttr"/>
                    <xs:attribute name="flags" type="xs:string">
                        
                    </xs:attribute>
                </xs:extension>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>

Element assert-serialization-error

assert-serialization-error

Asserts that the query can be executed without error, but serializing the result produces a serialization error. The result of the query must be serialized using the serialization options specified within the query (if any).

Formal declaration in XSD source form

    
    <xs:element name="assert-serialization-error" substitutionGroup="abstractAssertion">
        
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="xs:string">
                    <xs:attributeGroup ref="codeAttr"/>
                </xs:extension>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>

Element assert-empty

assert-empty

Asserts that the result of the test is an empty sequence.

Formal declaration in XSD source form

    
    <xs:element name="assert-empty" substitutionGroup="abstractAssertion">
        
    </xs:element>

Element assert-type

assert-type

Asserts that the result of the test matches the sequence type given as the value of the assert-type element.

Formal declaration in XSD source form

    
    <xs:element name="assert-type" substitutionGroup="abstractAssertion">
        
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="xs:string"/>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>

Element assert-true

assert-true

Asserts that the result of the test is the singleton boolean value true(). Note, the test expression must actually evaluate to true: this is not an assertion on the effective boolean value.

Formal declaration in XSD source form

    
    <xs:element name="assert-true" substitutionGroup="abstractAssertion">
        
    </xs:element>

Element assert-false

assert-true

Asserts that the result of the test is the singleton boolean value false(). Note, the test expression must actually evaluate to false: this is not an assertion on the effective boolean value.

Formal declaration in XSD source form

    
    <xs:element name="assert-false" substitutionGroup="abstractAssertion">
        
    </xs:element>

Element assert-string-value

assert-string-value

Asserts that the result of the test, after conversion to a string by applying the expression string-join(for $r in $result return string($r), " ") is equal to the string value of the assert-string-value element. Note that this test cannot be used if the result includes items that do not have a string value (elements with element-only content; function items) If the normalize-space attribute is present with the value true, then both the string value of the query result and the value of the assert-string-value element should be processed as if by the XPath normalize-space() function before the comparison.

Formal declaration in XSD source form

    
    <xs:element name="assert-string-value" substitutionGroup="abstractAssertion">
        
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="xs:string">
                    <xs:attribute name="normalize-space" type="xs:boolean" default="false"/>
                </xs:extension>
            </xs:simpleContent>
        </xs:complexType>
        
    </xs:element>

Element error

error

Asserts that the test is expected to fail with a static or dynamic error condition. The "code" attribute gives the expected error code.

For the purpose of official test reporting, an implementation is considered to pass a test if the test expects and error and the implementation raises an error, regardless whether the error codes match. Implementors are advised, however, that raising the wrong error code often indicates a problem, so it is advisable to detect this situation. When reporting requirements are finalized, we will be asking implementors to indicate tests which passed but raised a different error, so that we can assess the extent to which implementations are interoperable at the level of error codes.

Formal declaration in XSD source form

    
    <xs:element name="error" substitutionGroup="abstractAssertion">
        
        <xs:complexType>
            <xs:attributeGroup ref="codeAttr"/>
        </xs:complexType>
    </xs:element>

Attribute group documentAttr

document (as an attribute name)

denotes an attribute which provides a URI to be used as reference to specification.

Formal declaration in XSD source form

    
    <xs:attributeGroup name="documentAttr">
        
        <xs:attribute name="document" type="xs:anyURI"/>
    </xs:attributeGroup>

Attribute group codeAttr

code (as an attribute name)

denotes an attribute which in most cases provides a NCName to be used as an error code in the scope of a error element. The attribute gives the local name of the error code; the code is assumed to be in the standard error namespace.

The value "*" indicates that any error code is allowed.

The value may also be an EQName (Q{uri}local) to allow for user-defined error codes

Formal declaration in XSD source form

    
    <xs:attributeGroup name="codeAttr">
        
        <xs:attribute name="code">
            <xs:simpleType>
                <xs:union memberTypes="xs:NCName EQName">
                    <xs:simpleType>
                        <xs:restriction base="xs:string">
                            
                            <xs:enumeration value="*"/>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:union>
            </xs:simpleType>    
        </xs:attribute>
    </xs:attributeGroup>

Simple type EQName

Notes

Allows a user-defined error code to be expressed in the form Q{uri}local

Formal declaration in XSD source form

    
    <xs:simpleType name="EQName">
      
      <xs:restriction base="xs:string">
        <xs:pattern value="Q\{.*\}\i\c*"/>
      </xs:restriction>
    </xs:simpleType>

Attribute group fileAttr

file

This attribute provides a URI to be used as location of a resource within the test suite (for example, a source document, a query, a module, or a schema).

The URI will always be relative to the base URI of the XML document in which the attribute appears.

Formal declaration in XSD source form

    
    <xs:attributeGroup name="fileAttr">
        
        <xs:attribute name="file" type="xs:anyURI" use="optional"/>
    </xs:attributeGroup>

Attribute group roleAttr

role

Describes how a source document is made available to the query.

The value "." indicates that the source document will be the context item for the query.

A value in the form $varname indicates that the source document will be made available as the value of the external variable $varname. This variable will not be declared in the query (this is to allow the mechanism to be used in XPath). The query will always be such that it is possible to add declare variable declarations at the start before compiling the query.

If the source document is to be made available to the query using the doc() function, the "source" element should have a "uri" attribute, and the "role" attribute should be absent.

The "role" attribute should be omitted if the source is part of a collection definition.

Formal declaration in XSD source form

    
    <xs:attributeGroup name="roleAttr">
                    
        <xs:attribute name="role" type="xs:string" use="optional"/>
    </xs:attributeGroup>

Attribute group nameAttr

name

An attribute used to provide a string that uniquely names an object within some scope.

Formal declaration in XSD source form

    
    <xs:attributeGroup name="nameAttr">
        
        <xs:attribute name="name" type="xs:string"/>
    </xs:attributeGroup>

Attribute group coversAttr

covers

An attribute used to cross-reference tests or test-sets to the changes in the specification that the tests are designed to cover.

The value is syntactically similar to an xs:IDREFS value, in that it contains a space-separated list of change identifiers; however it is not actually an xs:IDREFS value, because the identfiers are in a different XML document, specifically the identifiers of changes appearing in the changes.xml file.

Formal declaration in XSD source form

    
    <xs:attributeGroup name="coversAttr">
        
        <xs:attribute name="covers" use="optional">
            <xs:simpleType>
                <xs:list itemType="xs:token"/>
            </xs:simpleType>
        </xs:attribute>    
    </xs:attributeGroup>

Attribute group covers30Attr

covers-30

An attribute used to cross-reference tests or test-sets to the changes in the 3.0 specification that the tests are designed to cover.

The value is syntactically similar to an xs:IDREFS value, in that it contains a space-separated list of change identifiers; however it is not actually an xs:IDREFS value, because the identfiers are in a different XML document, specifically the identifiers of changes appearing in the changes.xml file.

Formal declaration in XSD source form


    <xs:attributeGroup name="covers30Attr">
        
        <xs:attribute name="covers-30" use="optional">
            <xs:simpleType>
                <xs:list itemType="xs:NCName"/>
            </xs:simpleType>
        </xs:attribute>
    </xs:attributeGroup>

Attribute group creatorAttr

creator

An attribute used to name the creator of a test-case.

Use of this attribute does not constitute a claim to intellectual property rights.

The recommended form is as a personal name (first name, last name). An institutional name may be used if policy requires it.

Formal declaration in XSD source form

    
    <xs:attributeGroup name="creatorAttr">
        
        <xs:attribute name="creator" type="xs:string"/>
    </xs:attributeGroup>

Attribute group refAttr

ref

denotes an attribute which contains a reference to an object defined elsewhere in the test catalog, for example a reference to a named environment.

Note, this is not typed as xs:IDREF because the reference might be to an object in a different XML document.

Formal declaration in XSD source form

    
    <xs:attributeGroup name="refAttr">
        
        <xs:attribute name="ref" type="xs:string"/>
     </xs:attributeGroup>

Attribute group validationAttr

validation

indicates for a source document within an environment whether the source document is to be validated against the schema defined for that environment, and if so whether validation is to be strict or lax.

Formal declaration in XSD source form

    
   
    <xs:attributeGroup name="validationAttr">
        
        <xs:attribute name="validation" type="validationEnumType" use="optional"/>
    </xs:attributeGroup>

Attribute group media-typeAttr

media-type

Describes the media type of a resource.

The value should conform to RFC 2046.

Formal declaration in XSD source form

    
    <xs:attributeGroup name="media-typeAttr">
                    
        <xs:attribute name="media-type" type="xs:string" use="optional"/>
    </xs:attributeGroup>

Attribute group encodingAttr

encoding

Describes the encoding of a resource.

The value should be that of a character set registered with the Internet Assigned Numbers Authority.

Formal declaration in XSD source form

    
    <xs:attributeGroup name="encodingAttr">
                    
        <xs:attribute name="encoding" type="encodingType" use="optional"/>
    </xs:attributeGroup>

Simple type encodingType

Formal declaration in XSD source form

    
    <xs:simpleType name="encodingType">
      <xs:restriction base="xs:string">
	    <xs:pattern value="[A-Za-z]([A-Za-z0-9._-])*"/>
      </xs:restriction>
    </xs:simpleType>

Attribute group typeAttr

type

The type attribute of a dependency element indicates what type of dependency it is: the set of possible values is enumerated.

The most common type is spec, which indicates a dependency on specific versions of XPath or XQuery. In this case the corresponding value attribute is a space-separated list whose tokens are, for example, "XQ10" indicating XQuery 1.0, "XQ10+" indicating XQuery 1.0 or later, "XQ30+" indication XQuery 3.0 or later, or "XP20+" indicating XPath 2.0 or later. The tokens in the list are alternatives; the test may be run if any of the dependencies is satisfied.

Similarly, if the type is xml-version, the corresponding value is a space-separated list whose tokens are "1.0" (XML 1.0), "1.1" (XML 1.1), "1.0:5+" (1.0, 5th edition or later), "1.0:4-" (1.0, fourth edition or earlier).

Formal declaration in XSD source form


    <xs:attributeGroup name="typeAttr">
        
        <xs:attribute name="type" type="dependencyEnumType"/>
    </xs:attributeGroup>

Simple type dependencyEnumType

Formal declaration in XSD source form

    
    <xs:simpleType name="dependencyEnumType">
        <xs:restriction base="xs:normalizedString">
            <xs:enumeration value="calendar"/>
            <xs:enumeration value="collection-stability"/>
            <xs:enumeration value="default-language"/>
            <xs:enumeration value="directory-as-collection-uri"/>
            <xs:enumeration value="feature"/>
            <xs:enumeration value="format-integer-sequence"/>
            <xs:enumeration value="language"/>
            <xs:enumeration value="limits"/>
            <xs:enumeration value="spec"/>
            <xs:enumeration value="schemaAware"/>
            <xs:enumeration value="unicode-normalization-form"/>
            <xs:enumeration value="unicode-version"/>
            <xs:enumeration value="xml-version"/>
            <xs:enumeration value="xsd-version"/>
        </xs:restriction>
    </xs:simpleType>

Simple type validationEnumType

Formal declaration in XSD source form

    
    <xs:simpleType name="validationEnumType">
        <xs:restriction base="xs:normalizedString">
            <xs:enumeration value="strict"/>
            <xs:enumeration value="lax"/>
            <xs:enumeration value="skip"/>
        </xs:restriction>
    </xs:simpleType>

Attribute group valueAttr

value

As an attribute of the dependency element, provides a string value to be used to indicate the dependency.

Formal declaration in XSD source form

    
    
    <xs:attributeGroup name="valueAttr">
        
        <xs:attribute name="value" type="xs:string"/>
    </xs:attributeGroup>

Attribute group uriAttr

uri (as an attribute name)

This attribute provides a URI to be used as an abstract identifier of a resource within the test suite (for example, a source document, or a module). The URI is designed to be independent of the location of the resource.

The URI may be an absolute URI or a relative URI reference. If it is a relative URI reference, it is resolved relative to the base URI of the element in which it appears (in practice, that is, the base URI of the test-set catalog file).

For source documents, the URI can be used in a call to the doc() function to retrieve this source document (so the actual query does not need to know its location.

For modules, the URI defines the module URI and is again independent of location.

For schemas, the URI defines the target namespace URI.

Formal declaration in XSD source form

    
    <xs:attributeGroup name="uriAttr">
        
        <xs:attribute name="uri" type="xs:anyURI"/>
    </xs:attributeGroup>

Attribute group byAttr

by (as an attribute name)

The name of the person who created or modified a test-case or source document, schema etc.

Formal declaration in XSD source form

    
   
    
    <xs:attributeGroup name="byAttr">
        
        <xs:attribute name="by" type="xs:string"/>
    </xs:attributeGroup>

Attribute group onAttr

on (as an attribute name)

The date of an event such as the creation or modification of a test-case.

Formal declaration in XSD source form

    
    <xs:attributeGroup name="onAttr">
        
        <xs:attribute name="on" type="xs:date"/>
    </xs:attributeGroup>

Attribute group changeAttr

change (as an attribute name)

Textual explanation of a change made to a test-case.

Formal declaration in XSD source form

    
    <xs:attributeGroup name="changeAttr">
        
        <xs:attribute name="change" type="xs:string"/>
    </xs:attributeGroup>