<test-group xmlns="http://www.w3.org/2005/02/query-test-XQTSCatalog" is-XPath2="false" name="FunctionProlog" featureOwner="Oracle and Frans Englich">
   <GroupInfo>
      <title>Function Declaration</title>
      <description/>
   </GroupInfo>
   <test-case is-XPath2="false" name="function-declaration-001" FilePath="Expressions/PrologExpr/FunctionDeclaration/" scenario="standard" Creator="Pulkita Tyagi">
      <description>Demonstrate function declaration in different combination.</description>
      <spec-citation spec="XQuery" section-number="4.15" section-title="Function Declaration" section-pointer="FunctionDeclns"/>
      <query name="function-declaration-001" date="2005-08-30"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">function-declaration-001.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="function-declaration-002" FilePath="Expressions/PrologExpr/FunctionDeclaration/" scenario="standard" Creator="Pulkita Tyagi">
      <description>Demonstrate function declaration in different combination.</description>
      <spec-citation spec="XQuery" section-number="4.15" section-title="Function Declaration" section-pointer="FunctionDeclns"/>
      <query name="function-declaration-002" date="2005-08-30"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="XML">function-declaration-002.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="function-declaration-003" FilePath="Expressions/PrologExpr/FunctionDeclaration/" scenario="standard" Creator="Pulkita Tyagi">
      <description>Demonstrate function declaration in different combination.</description>
      <spec-citation spec="XQuery" section-number="4.15" section-title="Function Declaration" section-pointer="FunctionDeclns"/>
      <query name="function-declaration-003" static-name="function-declaration-003-static-cbcl" date="2005-08-30"/>
      <input-file role="principal-data" variable="input-context">bib</input-file>
      <output-file role="principal" compare="Fragment">function-declaration-003.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="function-declaration-004" FilePath="Expressions/PrologExpr/FunctionDeclaration/" scenario="standard" Creator="Pulkita Tyagi">
      <description>Demonstrate function declaration in different combination.</description>
      <spec-citation spec="XQuery" section-number="4.15" section-title="Function Declaration" section-pointer="FunctionDeclns"/>
      <query name="function-declaration-004" static-name="function-declaration-004-static-cbcl" date="2005-08-30"/>
      <input-file role="principal-data" variable="input-context">acme_corp</input-file>
      <output-file role="principal" compare="Fragment">function-declaration-004.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="function-declaration-005" FilePath="Expressions/PrologExpr/FunctionDeclaration/" scenario="standard" Creator="Pulkita Tyagi">
      <description>Demonstrate function declaration in different combination.</description>
      <spec-citation spec="XQuery" section-number="4.15" section-title="Function Declaration" section-pointer="FunctionDeclns"/>
      <query name="function-declaration-005" date="2005-08-30"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">function-declaration-005.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="function-declaration-006" FilePath="Expressions/PrologExpr/FunctionDeclaration/" scenario="standard" Creator="Pulkita Tyagi">
      <description>Demonstrate function declaration in different combination.</description>
      <spec-citation spec="XQuery" section-number="4.15" section-title="Function Declaration" section-pointer="FunctionDeclns"/>
      <query name="function-declaration-006" date="2005-08-30"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">function-declaration-006.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="function-declaration-007" FilePath="Expressions/PrologExpr/FunctionDeclaration/" scenario="standard" Creator="Pulkita Tyagi">
      <description>Demonstrate function declaration in different combination.</description>
      <spec-citation spec="XQuery" section-number="4.15" section-title="Function Declaration" section-pointer="FunctionDeclns"/>
      <query name="function-declaration-007" date="2005-08-30"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">function-declaration-007.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="function-declaration-008" FilePath="Expressions/PrologExpr/FunctionDeclaration/" scenario="standard" Creator="Pulkita Tyagi">
      <description>Demonstrate function declaration in different combination.</description>
      <spec-citation spec="XQuery" section-number="4.15" section-title="Function Declaration" section-pointer="FunctionDeclns"/>
      <query name="function-declaration-008" date="2005-08-30"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="XML">function-declaration-008.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="function-declaration-009" FilePath="Expressions/PrologExpr/FunctionDeclaration/" scenario="standard" Creator="Pulkita Tyagi">
      <description>Demonstrate function declaration in different combination.</description>
      <spec-citation spec="XQuery" section-number="4.15" section-title="Function Declaration" section-pointer="FunctionDeclns"/>
      <query name="function-declaration-009" date="2005-08-30"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="XML">function-declaration-009.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="function-declaration-010" FilePath="Expressions/PrologExpr/FunctionDeclaration/" scenario="standard" Creator="Pulkita Tyagi">
      <description>Demonstrate function declaration in different combination.</description>
      <spec-citation spec="XQuery" section-number="4.15" section-title="Function Declaration" section-pointer="FunctionDeclns"/>
      <query name="function-declaration-010" date="2005-08-30"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="XML">function-declaration-010.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="function-declaration-011" FilePath="Expressions/PrologExpr/FunctionDeclaration/" scenario="standard" Creator="Pulkita Tyagi">
      <description>Demonstrate function declaration - forward declaration.</description>
      <spec-citation spec="XQuery" section-number="4.15" section-title="Function Declaration" section-pointer="FunctionDeclns"/>
      <query name="function-declaration-011" date="2005-08-30"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">function-declaration-011.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="function-declaration-012" FilePath="Expressions/PrologExpr/FunctionDeclaration/" scenario="standard" Creator="Pulkita Tyagi">
      <description>Demonstrate function declaration in different combination.</description>
      <spec-citation spec="XQuery" section-number="4.15" section-title="Function Declaration" section-pointer="FunctionDeclns"/>
      <query name="function-declaration-012" date="2005-08-30"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">function-declaration-012.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="function-declaration-013" FilePath="Expressions/PrologExpr/FunctionDeclaration/" scenario="standard" Creator="Pulkita Tyagi">
      <description>Demonstrate function declaration in different combination.</description>
      <spec-citation spec="XQuery" section-number="4.15" section-title="Function Declaration" section-pointer="FunctionDeclns"/>
      <query name="function-declaration-013" date="2005-08-30"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">function-declaration-013.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="function-declaration-014" FilePath="Expressions/PrologExpr/FunctionDeclaration/" scenario="standard" Creator="Pulkita Tyagi">
      <description>Demonstrate function declaration in different combination.</description>
      <spec-citation spec="XQuery" section-number="4.15" section-title="Function Declaration" section-pointer="FunctionDeclns"/>
      <query name="function-declaration-014" date="2005-08-30"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">function-declaration-014.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="function-declaration-015" FilePath="Expressions/PrologExpr/FunctionDeclaration/" scenario="standard" Creator="Pulkita Tyagi">
      <description>Demonstrate function declaration in different combination.</description>
      <spec-citation spec="XQuery" section-number="4.15" section-title="Function Declaration" section-pointer="FunctionDeclns"/>
      <query name="function-declaration-015" date="2005-08-30"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">function-declaration-015.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="function-declaration-016" FilePath="Expressions/PrologExpr/FunctionDeclaration/" scenario="standard" Creator="Pulkita Tyagi">
      <description>Demonstrate function declaration in different combination.</description>
      <spec-citation spec="XQuery" section-number="4.15" section-title="Function Declaration" section-pointer="FunctionDeclns"/>
      <query name="function-declaration-016" date="2005-08-30"/>
      <input-file role="principal-data" variable="input-context">bib2</input-file>
      <output-file role="principal" compare="Fragment">function-declaration-016.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="function-declaration-017" FilePath="Expressions/PrologExpr/FunctionDeclaration/" scenario="standard" Creator="Pulkita Tyagi">
      <description>Demonstrate function declaration in different combination.</description>
      <spec-citation spec="XQuery" section-number="4.15" section-title="Function Declaration" section-pointer="FunctionDeclns"/>
      <query name="function-declaration-017" date="2005-08-30"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="XML">function-declaration-017.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="function-declaration-018" FilePath="Expressions/PrologExpr/FunctionDeclaration/" scenario="standard" Creator="Pulkita Tyagi">
      <description>Demonstrate function declaration in different combination.</description>
      <spec-citation spec="XQuery" section-number="4.15" section-title="Function Declaration" section-pointer="FunctionDeclns"/>
      <query name="function-declaration-018" date="2005-08-30"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="XML">function-declaration-018.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="function-declaration-019" FilePath="Expressions/PrologExpr/FunctionDeclaration/" scenario="standard" Creator="Pulkita Tyagi">
      <description>Demonstrate function declaration in different combination.</description>
      <spec-citation spec="XQuery" section-number="4.15" section-title="Function Declaration" section-pointer="FunctionDeclns"/>
      <query name="function-declaration-019" date="2005-08-30"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="XML">function-declaration-019.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="function-declaration-020" FilePath="Expressions/PrologExpr/FunctionDeclaration/" scenario="standard" Creator="Pulkita Tyagi">
      <description>Demonstrate function declaration - overloading.</description>
      <spec-citation spec="XQuery" section-number="4.15" section-title="Function Declaration" section-pointer="FunctionDeclns"/>
      <query name="function-declaration-020" date="2005-08-30"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">function-declaration-020.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="function-declaration-021" FilePath="Expressions/PrologExpr/FunctionDeclaration/" scenario="runtime-error" Creator="Ravindranath Chennoju">
      <description>Demonstrate function declaration - negative test.</description>
      <spec-citation spec="XQuery" section-number="4.15" section-title="Function Declaration" section-pointer="FunctionDeclns"/>
      <query name="function-declaration-021" date="2005-08-30"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPTY0004</expected-error>
   </test-case>
   <test-case is-XPath2="false" name="function-declaration-022" FilePath="Expressions/PrologExpr/FunctionDeclaration/" scenario="runtime-error" Creator="Ravindranath Chennoju">
      <description>Demonstrate function declaration - negative test.</description>
      <spec-citation spec="XQuery" section-number="4.15" section-title="Function Declaration" section-pointer="FunctionDeclns"/>
      <query name="function-declaration-022" date="2005-08-30"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XQST0034</expected-error>
   </test-case>
   <test-case is-XPath2="false" name="function-declaration-023" FilePath="Expressions/PrologExpr/FunctionDeclaration/" scenario="runtime-error" Creator="Ravindranath Chennoju">
      <description>Demonstrate function declaration - negative test.</description>
      <spec-citation spec="XQuery" section-number="4.15" section-title="Function Declaration" section-pointer="FunctionDeclns"/>
      <query name="function-declaration-023" date="2005-08-30"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XQST0045</expected-error>
      <expected-error>XPST0017</expected-error>
   </test-case>
   <test-case is-XPath2="false" name="function-declaration-024" FilePath="Expressions/PrologExpr/FunctionDeclaration/" scenario="runtime-error" Creator="Ravindranath Chennoju">
      <description>Demonstrate function declaration - negative test.</description>
      <spec-citation spec="XQuery" section-number="4.15" section-title="Function Declaration" section-pointer="FunctionDeclns"/>
      <query name="function-declaration-024" date="2005-08-30"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XQST0039</expected-error>
   </test-case>
   <test-case is-XPath2="false" name="function-declaration-025" FilePath="Expressions/PrologExpr/FunctionDeclaration/" scenario="runtime-error" Creator="Carmelo Montanez">
      <description>Evaluation of user defined function with no namespace.</description>
      <spec-citation spec="XQuery" section-number="4.15" section-title="Function Declaration" section-pointer="FunctionDeclns"/>
      <query name="function-declaration-025" date="2006-02-06"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XQST0060</expected-error>
   </test-case>
   <test-case is-XPath2="false" name="function-declaration-026" FilePath="Expressions/PrologExpr/FunctionDeclaration/" scenario="standard" Creator="Frans Englich">
      <description>Use a global variable which has a node test, from within a function.</description>
      <query name="function-declaration-026" date="2008-10-20"/>
      <contextItem role="principal-data">works-mod</contextItem>
      <output-file role="principal" compare="Text">function-declaration-026.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-1" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="standard">
      <description>The 'XPath Data Types' namespace is not reserved anymore, although it was in older drafts.</description>
      <query name="K-FunctionProlog-1" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K-FunctionProlog-1.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-2" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>A function cannot be declared in the 'http://www.w3.org/2005/xpath-functions' namespace.</description>
      <query name="K-FunctionProlog-2" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XQST0045</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-3" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>A function cannot be declared in the 'http://www.w3.org/XML/1998/namespace' namespace.</description>
      <query name="K-FunctionProlog-3" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XQST0045</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-4" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>A function cannot be declared in the 'http://www.w3.org/2001/XMLSchema-instance' namespace.</description>
      <query name="K-FunctionProlog-4" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XQST0045</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-5" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>A function cannot be declared in the 'http://www.w3.org/2001/XMLSchema' namespace.</description>
      <query name="K-FunctionProlog-5" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XQST0045</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-6" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="parse-error">
      <description>Arguments in functions cannot have default values initialized with '='(or in any other way).</description>
      <query name="K-FunctionProlog-6" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPST0003</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-7" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="parse-error">
      <description>Arguments in functions cannot have default values initialized with '='(or in any other way).</description>
      <query name="K-FunctionProlog-7" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPST0003</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-8" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="parse-error">
      <description>Arguments in functions cannot have default values initialized with ':='(or in any other way).</description>
      <query name="K-FunctionProlog-8" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPST0003</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-9" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="parse-error">
      <description>Arguments in functions cannot have default values initialized with ':='(or in any other way).</description>
      <query name="K-FunctionProlog-9" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPST0003</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-10" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>A user declared function whose return value simply doesn't match the return type.</description>
      <query name="K-FunctionProlog-10" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPTY0004</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-11" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>A user declared function whose return value simply doesn't match the return type(#2).</description>
      <query name="K-FunctionProlog-11" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPTY0004</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-12" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>Variables appearing after a function declaration is not in scope inside the function.</description>
      <query name="K-FunctionProlog-12" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPST0008</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-13" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="parse-error">
      <description>Namespaces declarations appearing after a function declaration are not in scope inside the function.</description>
      <query name="K-FunctionProlog-13" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPST0081</expected-error>
      <expected-error>XPST0003</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-14" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>A user function which when run doesn't match the declared returned type.</description>
      <query name="K-FunctionProlog-14" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPTY0004</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-15" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="standard">
      <description>A user function whose return type doesn't match the body, which can be statically inferred.</description>
      <query name="K-FunctionProlog-15" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K-FunctionProlog-15.txt</output-file>
      <expected-error>XPTY0004</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-16" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="parse-error">
      <description>When declaring a function, the paranteses must be present even though it doesn't have any arguments.</description>
      <query name="K-FunctionProlog-16" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPST0003</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-17" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="parse-error">
      <description>When declaring a function, the paranteses must be present even though it doesn't have any arguments.</description>
      <query name="K-FunctionProlog-17" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPST0003</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-18" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="standard">
      <description>Two user functions using global variables.</description>
      <query name="K-FunctionProlog-18" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K-FunctionProlog-18.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-19" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="standard">
      <description>A user function where all its arguments are unused.</description>
      <query name="K-FunctionProlog-19" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K-FunctionProlog-19.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-20" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="standard">
      <description>User functions which in some implementations causes constant propagation combined with function versioning.</description>
      <query name="K-FunctionProlog-20" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K-FunctionProlog-20.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-21" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="standard">
      <description>User functions where the middle argument of three arguments is unused.</description>
      <query name="K-FunctionProlog-21" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K-FunctionProlog-21.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-22" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="standard">
      <description>User functions where the first argument of three arguments is unused.</description>
      <query name="K-FunctionProlog-22" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K-FunctionProlog-22.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-23" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="standard">
      <description>User functions where the last argument of three arguments is unused.</description>
      <query name="K-FunctionProlog-23" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K-FunctionProlog-23.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-24" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>A function cannot be declared in the 'http://www.w3.org/2005/xpath-functions' namespace.</description>
      <query name="K-FunctionProlog-24" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XQST0045</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-25" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="standard">
      <description>A function and a variable can have the same name.</description>
      <query name="K-FunctionProlog-25" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K-FunctionProlog-25.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-26" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>A function declaration duplicated.</description>
      <query name="K-FunctionProlog-26" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XQST0034</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-27" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>A function declaration duplicated; difference in return types is insignificant.</description>
      <query name="K-FunctionProlog-27" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XQST0034</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-28" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>A function declaration duplicated; difference in arguments types is insignificant.</description>
      <query name="K-FunctionProlog-28" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XQST0034</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-29" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>A function declaration duplicated; difference in arguments name is insignificant.</description>
      <query name="K-FunctionProlog-29" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XQST0034</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-30" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="standard">
      <description>Overloading user functions based on arity.</description>
      <query name="K-FunctionProlog-30" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K-FunctionProlog-30.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-31" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>One cannot declare a user function as fn:count.</description>
      <query name="K-FunctionProlog-31" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XQST0045</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-32" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>One cannot declare a user function as xs:gYear.</description>
      <query name="K-FunctionProlog-32" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XQST0045</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-33" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>A type error inside a function.</description>
      <query name="K-FunctionProlog-33" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K-FunctionProlog-33.txt</output-file>
      <expected-error>XPTY0004</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-34" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>A call to a user declared function which almost is spelled correctly(capitalization wrong).</description>
      <query name="K-FunctionProlog-34" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPST0017</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-35" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>A call to a user declared function which almost is spelled correctly(#2).</description>
      <query name="K-FunctionProlog-35" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPST0017</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-36" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>The variable '$myArg' is in scope inside the function, but not in the query body.</description>
      <query name="K-FunctionProlog-36" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPST0008</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-37" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>The variable '$myArg' is in scope inside one function, but not the other function.</description>
      <query name="K-FunctionProlog-37" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPST0008</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-38" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>The variable '$myArg2' is in scope inside one function, but not the other function.</description>
      <query name="K-FunctionProlog-38" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPST0008</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-39" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="standard">
      <description>Function arguments shadows global variables.</description>
      <query name="K-FunctionProlog-39" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K-FunctionProlog-39.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-40" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="standard">
      <description>Variables declared inside functions shadow function arguments.</description>
      <query name="K-FunctionProlog-40" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K-FunctionProlog-40.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-41" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>Type error in body of user function caused by the argument value.</description>
      <query name="K-FunctionProlog-41" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPTY0004</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-42" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>Type error(cardinality) in return value of user function caused by the argument value.</description>
      <query name="K-FunctionProlog-42" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPTY0004</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-43" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>Item type error in argument value.</description>
      <query name="K-FunctionProlog-43" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPTY0004</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-44" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>Cardinality error in argument value.</description>
      <query name="K-FunctionProlog-44" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPTY0004</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-45" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>Item type error in argument value. xs:decimal doesn't match xs:integer.</description>
      <query name="K-FunctionProlog-45" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPTY0004</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-46" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>'1' doesn't match the empty-sequence().</description>
      <query name="K-FunctionProlog-46" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPTY0004</expected-error>
      <expected-error>XPST0005</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-47" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="parse-error">
      <description>'empty-sequence()+' is syntactically invalid.</description>
      <query name="K-FunctionProlog-47" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPST0003</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-48" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="parse-error">
      <description>'empty-sequence()? is syntactically invalid.</description>
      <query name="K-FunctionProlog-48" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPST0003</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-49" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="standard">
      <description>It is valid to declare an argument to be of type empty-sequence().</description>
      <query name="K-FunctionProlog-49" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K-FunctionProlog-49.txt</output-file>
      <expected-error>XPST0005</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-50" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>empty-sequence() as return type, but body doesn't match when run.</description>
      <query name="K-FunctionProlog-50" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPTY0004</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-51" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>Too few arguments passed to a user function.</description>
      <query name="K-FunctionProlog-51" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPST0017</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-52" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>empty-sequence() as return type, and a body containing fn:error().</description>
      <query name="K-FunctionProlog-52" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>FOER0000</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-53" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="standard">
      <description>A global variable referenced from inside a function.</description>
      <query name="K-FunctionProlog-53" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K-FunctionProlog-53.txt</output-file>
      <expected-error>XPST0005</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-54" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>A more realistic case involving fn:error().</description>
      <query name="K-FunctionProlog-54" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>*</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-55" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>A more realistic case involving fn:error(), #2.</description>
      <query name="K-FunctionProlog-55" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>*</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-56" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="standard">
      <description>A more realistic case involving fn:error(), #3.</description>
      <query name="K-FunctionProlog-56" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K-FunctionProlog-56.txt</output-file>
      <expected-error>XPST0005</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-57" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>The type 'none' isn't available to users.</description>
      <query name="K-FunctionProlog-57" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPST0051</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-58" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="parse-error">
      <description>The type 'none()' isn't available to users.</description>
      <query name="K-FunctionProlog-58" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPST0003</expected-error>
      <expected-error>XPST0051</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-59" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="standard">
      <description>A call to a user function where the argument in the callsite corresponding to an unused argument contains a type error.</description>
      <query name="K-FunctionProlog-59" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K-FunctionProlog-59.txt</output-file>
      <expected-error>XPTY0004</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-60" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>An argument in a user function is not in scope in the query body.</description>
      <query name="K-FunctionProlog-60" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPST0008</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-61" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>An argument in a user function is not in scope in the query body.</description>
      <query name="K-FunctionProlog-61" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPST0008</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-62" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="standard">
      <description>Check that a global variable is in scope despite an unused function being declared.</description>
      <query name="K-FunctionProlog-62" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K-FunctionProlog-62.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-63" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>A function call that could be a call to a hypotehical user function.</description>
      <query name="K-FunctionProlog-63" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPST0017</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-64" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>A function call that could be a call to a hypothetical user function(#2).</description>
      <query name="K-FunctionProlog-64" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPST0017</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-65" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>Since the return type is empty-sequence() it is a type error(XPTY0004) to pass its return value to anything which requires cardinality exactly-one. That the function's body is of type 'none', doesn't affect that, it only adapts to the declared return type. However, there's no constraints on what is reported first, so FOER0000 can also be issued.</description>
      <query name="K-FunctionProlog-65" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPTY0004</expected-error>
      <expected-error>FOER0000</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-66" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>If static typing is in use, XPTY004 is issued since local:myFunction() has static type item()*. However, if the function is invoked FOER0000 is issued.</description>
      <query name="K-FunctionProlog-66" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>FOER0000</expected-error>
      <expected-error>XPTY0004</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-67" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="standard">
      <description>A function call that reminds of the range expression.</description>
      <query name="K-FunctionProlog-67" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K-FunctionProlog-67.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-FunctionProlog-68" FilePath="Expressions/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>A call to a user function where the argument in the callsite corresponding to a used argument contains a type error.</description>
      <query name="K-FunctionProlog-68" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPTY0004</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-1" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="standard">
      <description>Have two function callsites as arguments to 'eq'.</description>
      <query name="K2-FunctionProlog-1" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K2-FunctionProlog-1.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-2" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="standard">
      <description>Have two function callsites as arguments to 'ne'.</description>
      <query name="K2-FunctionProlog-2" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K2-FunctionProlog-2.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-3" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="standard">
      <description>Have two function callsites as arguments to '='.</description>
      <query name="K2-FunctionProlog-3" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K2-FunctionProlog-3.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-4" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="standard">
      <description>Have two function callsites as arguments to '!='.</description>
      <query name="K2-FunctionProlog-4" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K2-FunctionProlog-4.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-5" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>A function requiring xs:integer but is passed an xs:decimal.</description>
      <query name="K2-FunctionProlog-5" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPTY0004</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-6" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>A function requiring xs:integer as return value, but is passed xs:decimal.</description>
      <query name="K2-FunctionProlog-6" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPTY0004</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-7" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="standard">
      <description>A declared return value invokes numeric promotion.</description>
      <query name="K2-FunctionProlog-7" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K2-FunctionProlog-7.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-8" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="standard">
      <description>A recursive function stretching through several function calls.</description>
      <query name="K2-FunctionProlog-8" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K2-FunctionProlog-8.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-9" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="standard">
      <description>A recursive function multiplying a sequence.</description>
      <query name="K2-FunctionProlog-9" static-name="K2-FunctionProlog-9-static-cbcl" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K2-FunctionProlog-9.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-10" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="standard">
      <description>A function whose name is only '_' and is declared in the default namespace.</description>
      <query name="K2-FunctionProlog-10" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K2-FunctionProlog-10.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-11" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="standard">
      <description>A function whose name is only '_'.</description>
      <query name="K2-FunctionProlog-11" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K2-FunctionProlog-11.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-12" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>An argument requiring a node, but is passed an integer.</description>
      <query name="K2-FunctionProlog-12" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPTY0004</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-13" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="standard">
      <description>An argument requiring a node, but is passed an integer(#2).</description>
      <query name="K2-FunctionProlog-13" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K2-FunctionProlog-13.txt</output-file>
      <expected-error>XPTY0004</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-14" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>A focus doesn't propagate into function.</description>
      <query static-name="K2-FunctionProlog-14-static" name="K2-FunctionProlog-14" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPDY0002</expected-error>
      <expected-error>XPST0005</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-15" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="standard">
      <description>Use a range variable inside the assignment expression of a global variable.</description>
      <query name="K2-FunctionProlog-15" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K2-FunctionProlog-15.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-16" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="standard">
      <description>Ensure three subsequent stars are parsed.</description>
      <query name="K2-FunctionProlog-16" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K2-FunctionProlog-16.txt</output-file>
      <expected-error>XPDY0002</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-17" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="standard">
      <description>Conversions are invoked when an element is returned from a function with declared return type xs:integer.</description>
      <query name="K2-FunctionProlog-17" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K2-FunctionProlog-17.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-18" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="standard">
      <description>Conversions are invoked when an attribute is returned from a function with declared return type xs:integer.</description>
      <query name="K2-FunctionProlog-18" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K2-FunctionProlog-18.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-19" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="standard">
      <description>Conversions are invoked when a document is returned from a function with declared return type xs:integer.</description>
      <query name="K2-FunctionProlog-19" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K2-FunctionProlog-19.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-20" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>Comments cannot be converted into xs:integer.</description>
      <query name="K2-FunctionProlog-20" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPTY0004</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-21" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>Processing instructions cannot be converted into xs:integer.</description>
      <query name="K2-FunctionProlog-21" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPTY0004</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-22" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="standard">
      <description>Conversions are invoked when a text node is returned from a function with declared return type xs:integer.</description>
      <query name="K2-FunctionProlog-22" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K2-FunctionProlog-22.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-23" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="standard">
      <description>Call a function that subsequently calls a recursive function.</description>
      <query name="K2-FunctionProlog-23" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K2-FunctionProlog-23.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-24" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>The empty string cannot be cast to an xs:boolean.</description>
      <query name="K2-FunctionProlog-24" static-name="K2-FunctionProlog-24-static-cbcl" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>FORG0001</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-25" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="standard">
      <description>A call site that has an operand that gets treated as an xs:integer.</description>
      <query name="K2-FunctionProlog-25" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="XML">K2-FunctionProlog-25.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-26" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>A type declaration whose body doesn't match.</description>
      <query name="K2-FunctionProlog-26" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPTY0004</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-27" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>A type declaration whose body doesn't match(#2).</description>
      <query name="K2-FunctionProlog-27" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPTY0004</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-28" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="standard">
      <description>Compute the levenshtein distance between strings.</description>
      <query name="K2-FunctionProlog-28" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K2-FunctionProlog-28.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-29" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>Ensure the 'function' keyword is parsed correctly.</description>
      <query name="K2-FunctionProlog-29" date="2008-01-03+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPDY0002</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-30" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>Ensure an invalid value, reached through conversions, is reported as invalid.</description>
      <query name="K2-FunctionProlog-30" date="2008-03-05+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>FORG0001</expected-error>
      <expected-error>XPTY0004</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-31" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="standard">
      <description>Pass a sequence of mixed atomic values and nodes to an argument which has no type declared.</description>
      <query name="K2-FunctionProlog-31" date="2008-03-05+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K2-FunctionProlog-31.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-32" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>Pass a value which cannot be converted to the expected type.</description>
      <query name="K2-FunctionProlog-32" date="2008-03-05+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPTY0004</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-33" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="standard">
      <description>Mix in an atomic value which doesn't match the type it's being converted to.</description>
      <query name="K2-FunctionProlog-33" date="2008-03-05+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K2-FunctionProlog-33.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-34" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="standard">
      <description>Call fn:true() and fn:false() and pass to a user function.</description>
      <query name="K2-FunctionProlog-34" date="2008-03-05+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K2-FunctionProlog-34.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-35" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="standard">
      <description>Call fn:true() and fn:false() and pass to a user function.</description>
      <query name="K2-FunctionProlog-35" date="2008-03-05+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K2-FunctionProlog-35.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-36" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="standard">
      <description>Call fn:true() and fn:false() and pass to a user function(different cardinality).</description>
      <query name="K2-FunctionProlog-36" date="2008-03-05+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K2-FunctionProlog-36.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-37" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="standard">
      <description>Mix in an atomic value which matches the type it's being converted to.</description>
      <query name="K2-FunctionProlog-37" date="2008-03-05+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K2-FunctionProlog-37.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-38" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="runtime-error">
      <description>Trigger a crash in an implementation by having a user declared function with type, that has a text node constructor containing a call to a nonexisting function.</description>
      <query name="K2-FunctionProlog-38" date="2008-11-13+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPST0017</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-39" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="standard">
      <description>Use complex real-world case for function calls, with automatic conversion not needed.</description>
      <query name="K2-FunctionProlog-39" date="2008-11-13+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K2-FunctionProlog-39.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-FunctionProlog-40" FilePath="exprSeqTypes/PrologExpr/FunctionProlog/" scenario="standard">
      <description>Use complex real-world case for function calls, with automatic conversion.</description>
      <query name="K2-FunctionProlog-40" date="2008-11-13+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K2-FunctionProlog-40.txt</output-file>
   </test-case>
</test-group>