W3C

Guidelines for XML Query Update Test Suite Submissions

Licensing Issues and Acceptance

Conformance to Schemas and File Format

Test Structure

<test-case name="id-insert-expr-06" FilePath= ... >
<description>Evaluates a simple insert expression with "after" clause only. ... </description>
<spec-citation spec="XQUPDATE" section-number="2.4.1" ... section-pointer="#id-insert"/>
<state time="0">
<query name="id-insert-expr-06" date="2007-06-04"/>
<input-file role="principal-data" variable="input-context">works-mod</input-file>
</state>
<state time="1">
<query name="id-insert-expr-06-test" date="2007-06-04"/>
<input-file role="principal-data" variable="input-context">works-mod</input-file>
<output-file role="principal" compare="Fragment">id-insert-expr-06.xml</output-file>
</state>
</test-case>

(: Name: id-insert-expr-023 :)
(: Description: Evaluation of simple insert expression where source expression is an updating expression. :)
(: insert-start :)
declare variable $input-context external;
(: insert-end :)
let $var := $input-context/employees[1]/employee[2]
return
do insert (do insert <salary>150000</salary> into $var) into $var

Collations and URI’s

Static Typing

Optional Features and vendor Specific Features

Error Tests

Error conditions that can be mapped to the conditions specified in the appendices of the XML Query Update specifications should include the error code stated for that condition. The following example from the catalog file illustrates one of such conditions:

<test-case name="id-insert-expr-029" FilePath="InsertExpressions/" scenario="runtime-error" Creator="Carmelo Montanez">
<description>Evaluates an insert expression where the target expression evaluates to a number.</description>
<spec-citation spec="XQUPDATE" section-number="2.4.1" section-title="Insert" section-pointer="#id-insert"/>
<state time="0">
<query name="id-insert-expr-029" date="2007-06-04"/>
<input-file role="principal-data" variable="input-context">employeesNIST</input-file>
<expected-error>XUTY0005</expected-error>
</state>
</test-case>

Any error condition for which there is not a predefined code, the "*" symbol should be used.

External Variable Tests

External variable tests are designed to run queries, whose external variable values are defined by outsite agents. The main catalog will define an <input-query> element. The results of the input query (s) are bind to external variables defined in the main query. The <input-query> element require three attributes, namely:

  1. name - specifies the name of the input query (no extension required).
  2. variable - the name of the variable to which the results of the query should be binded.
  3. date - the date the query was written.

The following table illustrates a possible entry for an external variable test case:

  <test-case name="extvardeclwithtype-17" ...>
   <description>External Variable used to evaluate a boolean expression ... .</description>
   <spec-citation spec="XQuery" section-number="4.14" ... />
   <state time = "0">
    <query name="extvardeclwithtype-17" date="2006-02-09"/>
    <input-file role="principal-data" variable="input-context">emptydoc</input-file>
    <input-query variable="x" name="extvardeclwithtypetobind-17" date="2006-02-09"/>
    <output-file role="principal" compare="Text">extvardeclwithtype-17.txt</output-file>
   </state>
  </test-case>

The following are the input query and the main query that corresponds to the entry above:

Input Query

   (: Name: extvardeclwithtypetobind-17 :)
   (: Description: Binding boolean expression for extvardeclwithtype-17.:)

   let $var := fn:true() or fn:true()
   return $var

Main Query

     (: Name: extvardeclwithtype-17 :)
     (: Description: Evaluates an external variable used in a boolean expression:)
     (: Both queries perform the operation. :)

     declare variable $x as xs:boolean external;
     $x or fn:false()

Note the name(s) of the external variable(s) defined in the main query must match the names of the variable(s) defined in the input queries ("x" in this case). The main query must be a stand alone query, it should have no input infosets. At this point, it is not forseen that a lot of tests will be available for the Update facility test suite.

XML and Namespaces

XML Encoding

Related Specifications

Results and Serialization

Expected Results


Webmaster · Last modified: $Date: 2007/10/04 15:56:22 $ by $Author: aeisenbe2 $

Copyright © 1994-2005 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark, document use and software licensing rules apply. Your interactions with this site are in accordance with our public and Member privacy statements.