<test-group xmlns="http://www.w3.org/2005/02/query-test-XQTSCatalog" is-XPath2="false" name="InternalVariablesWith" featureOwner="NIST and Frans Englich">
   <GroupInfo>
      <title>Internal Variable References with TypeDeclatation</title>
      <description/>
   </GroupInfo>
   <test-case is-XPath2="false" name="vardeclwithtype-1" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="standard" Creator="Carmelo Montanez">
      <description>Evaluates declare variable feature with type. Use xs:string.</description>
      <spec-citation spec="XQuery" section-number="4.14" section-title="Variable Declaration" section-pointer="id-variable-declarations"/>
      <spec-citation spec="XQuery" section-number="3.1.2" section-title="Variable References" section-pointer="id-variables"/>
      <query name="vardeclwithtype-1" date="2005-11-23"/>
      <input-file role="principal-data" variable="input-context1">emptydoc</input-file>
      <output-file role="principal" compare="Text">vardeclwithtype-1.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="vardeclwithtype-2" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="standard" Creator="Carmelo Montanez">
      <description>Evaluates declare variable feature with type. Use xs:integer.</description>
      <spec-citation spec="XQuery" section-number="4.14" section-title="Variable Declaration" section-pointer="id-variable-declarations"/>
      <spec-citation spec="XQuery" section-number="3.1.2" section-title="Variable References" section-pointer="id-variables"/>
      <query name="vardeclwithtype-2" date="2005-11-23"/>
      <input-file role="principal-data" variable="input-context1">emptydoc</input-file>
      <output-file role="principal" compare="Text">vardeclwithtype-2.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="vardeclwithtype-3" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="standard" Creator="Carmelo Montanez">
      <description>Evaluates declare variable feature with type. Use xs:decimal.</description>
      <spec-citation spec="XQuery" section-number="4.14" section-title="Variable Declaration" section-pointer="id-variable-declarations"/>
      <spec-citation spec="XQuery" section-number="3.1.2" section-title="Variable References" section-pointer="id-variables"/>
      <query name="vardeclwithtype-3" date="2005-11-23"/>
      <input-file role="principal-data" variable="input-context1">emptydoc</input-file>
      <output-file role="principal" compare="Text">vardeclwithtype-3.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="vardeclwithtype-4" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="standard" Creator="Carmelo Montanez">
      <description>Evaluates declare variable feature with type. Use xs:boolean (true value).</description>
      <spec-citation spec="XQuery" section-number="4.14" section-title="Variable Declaration" section-pointer="id-variable-declarations"/>
      <spec-citation spec="XQuery" section-number="3.1.2" section-title="Variable References" section-pointer="id-variables"/>
      <query name="vardeclwithtype-4" date="2005-11-23"/>
      <input-file role="principal-data" variable="input-context1">emptydoc</input-file>
      <output-file role="principal" compare="Text">vardeclwithtype-4.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="vardeclwithtype-5" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="standard" Creator="Carmelo Montanez">
      <description>Evaluates declare variable feature with type. Use xs:boolean (false value).</description>
      <spec-citation spec="XQuery" section-number="4.14" section-title="Variable Declaration" section-pointer="id-variable-declarations"/>
      <spec-citation spec="XQuery" section-number="3.1.2" section-title="Variable References" section-pointer="id-variables"/>
      <query name="vardeclwithtype-5" date="2005-11-23"/>
      <input-file role="principal-data" variable="input-context1">emptydoc</input-file>
      <output-file role="principal" compare="Text">vardeclwithtype-5.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="vardeclwithtype-6" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="standard" Creator="Carmelo Montanez">
      <description>Evaluates declare variable feature with type. Use xs:float.</description>
      <spec-citation spec="XQuery" section-number="4.14" section-title="Variable Declaration" section-pointer="id-variable-declarations"/>
      <spec-citation spec="XQuery" section-number="3.1.2" section-title="Variable References" section-pointer="id-variables"/>
      <query name="vardeclwithtype-6" date="2005-11-23"/>
      <input-file role="principal-data" variable="input-context1">emptydoc</input-file>
      <output-file role="principal" compare="Text">vardeclwithtype-6.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="vardeclwithtype-7" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="standard" Creator="Carmelo Montanez">
      <description>Evaluates declare variable feature with type. Use xs:double.</description>
      <spec-citation spec="XQuery" section-number="4.14" section-title="Variable Declaration" section-pointer="id-variable-declarations"/>
      <spec-citation spec="XQuery" section-number="3.1.2" section-title="Variable References" section-pointer="id-variables"/>
      <query name="vardeclwithtype-7" date="2005-11-23"/>
      <input-file role="principal-data" variable="input-context1">emptydoc</input-file>
      <output-file role="principal" compare="Text">vardeclwithtype-7.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="vardeclwithtype-8" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="standard" Creator="Carmelo Montanez">
      <description>Evaluates declare variable feature with type. Use xs:anyURI.</description>
      <spec-citation spec="XQuery" section-number="4.14" section-title="Variable Declaration" section-pointer="id-variable-declarations"/>
      <spec-citation spec="XQuery" section-number="3.1.2" section-title="Variable References" section-pointer="id-variables"/>
      <query name="vardeclwithtype-8" date="2005-11-23"/>
      <input-file role="principal-data" variable="input-context1">emptydoc</input-file>
      <output-file role="principal" compare="Text">vardeclwithtype-8.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="vardeclwithtype-9" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="standard" Creator="Carmelo Montanez">
      <description>Evaluates declare variable feature with type. Use xs:dateTime.</description>
      <spec-citation spec="XQuery" section-number="4.14" section-title="Variable Declaration" section-pointer="id-variable-declarations"/>
      <spec-citation spec="XQuery" section-number="3.1.2" section-title="Variable References" section-pointer="id-variables"/>
      <query name="vardeclwithtype-9" date="2005-11-23"/>
      <input-file role="principal-data" variable="input-context1">emptydoc</input-file>
      <output-file role="principal" compare="Text">vardeclwithtype-9.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="vardeclwithtype-10" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="standard" Creator="Carmelo Montanez">
      <description>Evaluates declare variable feature with type. Use xs:time.</description>
      <spec-citation spec="XQuery" section-number="4.14" section-title="Variable Declaration" section-pointer="id-variable-declarations"/>
      <spec-citation spec="XQuery" section-number="3.1.2" section-title="Variable References" section-pointer="id-variables"/>
      <query name="vardeclwithtype-10" date="2005-11-23"/>
      <input-file role="principal-data" variable="input-context1">emptydoc</input-file>
      <output-file role="principal" compare="Text">vardeclwithtype-10.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="vardeclwithtype-11" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="standard" Creator="Carmelo Montanez">
      <description>Evaluates declare variable feature with type. Use xs:date.</description>
      <spec-citation spec="XQuery" section-number="4.14" section-title="Variable Declaration" section-pointer="id-variable-declarations"/>
      <spec-citation spec="XQuery" section-number="3.1.2" section-title="Variable References" section-pointer="id-variables"/>
      <query name="vardeclwithtype-11" date="2005-11-23"/>
      <input-file role="principal-data" variable="input-context1">emptydoc</input-file>
      <output-file role="principal" compare="Text">vardeclwithtype-11.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="vardeclwithtype-12" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="runtime-error" Creator="Carmelo Montanez">
      <description>Evaluates declare variable feature with type. same variable declared twice.</description>
      <spec-citation spec="XQuery" section-number="4.14" section-title="Variable Declaration" section-pointer="id-variable-declarations"/>
      <spec-citation spec="XQuery" section-number="3.1.2" section-title="Variable References" section-pointer="id-variables"/>
      <query name="vardeclwithtype-12" date="2005-11-23"/>
      <input-file role="principal-data" variable="input-context1">emptydoc</input-file>
      <expected-error>XQST0049</expected-error>
   </test-case>
   <test-case is-XPath2="false" name="vardeclwithtype-13" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="runtime-error" Creator="Carmelo Montanez">
      <description>Evaluates declare variable feature with type and expression. Expression returns different type that declared variable type.</description>
      <spec-citation spec="XQuery" section-number="4.14" section-title="Variable Declaration" section-pointer="id-variable-declarations"/>
      <spec-citation spec="XQuery" section-number="3.1.2" section-title="Variable References" section-pointer="id-variables"/>
      <query name="vardeclwithtype-13" date="2005-11-23"/>
      <input-file role="principal-data" variable="input-context1">emptydoc</input-file>
      <expected-error>XPTY0004</expected-error>
   </test-case>
   <test-case is-XPath2="false" name="vardeclwithtype-14" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="standard" Creator="Carmelo Montanez">
      <description>Evaluates declare variable feature with type that uses a previously defined variable.</description>
      <spec-citation spec="XQuery" section-number="4.14" section-title="Variable Declaration" section-pointer="id-variable-declarations"/>
      <spec-citation spec="XQuery" section-number="3.1.2" section-title="Variable References" section-pointer="id-variables"/>
      <query name="vardeclwithtype-14" date="2005-11-23"/>
      <input-file role="principal-data" variable="input-context1">emptydoc</input-file>
      <output-file role="principal" compare="Text">vardeclwithtype-14.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="vardeclwithtype-15" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="runtime-error" Creator="Carmelo Montanez">
      <description>Evaluates declare variable feature with type and expression. Expression uses variable not yet declared.</description>
      <spec-citation spec="XQuery" section-number="4.14" section-title="Variable Declaration" section-pointer="id-variable-declarations"/>
      <spec-citation spec="XQuery" section-number="3.1.2" section-title="Variable References" section-pointer="id-variables"/>
      <query name="vardeclwithtype-15" date="2005-11-23"/>
      <input-file role="principal-data" variable="input-context1">emptydoc</input-file>
      <expected-error>XPST0008</expected-error>
   </test-case>
   <test-case is-XPath2="false" name="vardeclwithtype-16" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="standard" Creator="Carmelo Montanez">
      <description>Evaluates declare variable feature with type that uses a declared namespace.</description>
      <spec-citation spec="XQuery" section-number="4.14" section-title="Variable Declaration" section-pointer="id-variable-declarations"/>
      <spec-citation spec="XQuery" section-number="3.1.2" section-title="Variable References" section-pointer="id-variables"/>
      <query name="vardeclwithtype-16" date="2005-11-23"/>
      <input-file role="principal-data" variable="input-context1">emptydoc</input-file>
      <output-file role="principal" compare="Text">vardeclwithtype-16.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="vardeclwithtype-17" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="standard" Creator="Carmelo Montanez">
      <description>Evaluates declare variable feature with type that uses a declared namespace. Two variables declared with different namespaces.</description>
      <spec-citation spec="XQuery" section-number="4.14" section-title="Variable Declaration" section-pointer="id-variable-declarations"/>
      <spec-citation spec="XQuery" section-number="3.1.2" section-title="Variable References" section-pointer="id-variables"/>
      <query name="vardeclwithtype-17" date="2005-11-23"/>
      <input-file role="principal-data" variable="input-context1">emptydoc</input-file>
      <output-file role="principal" compare="Text">vardeclwithtype-17.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="vardeclwithtype-18" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="runtime-error" Creator="Carmelo Montanez">
      <description>Evaluates declare variable feature with type. Variable declared on two uri's taht are the same.</description>
      <spec-citation spec="XQuery" section-number="4.14" section-title="Variable Declaration" section-pointer="id-variable-declarations"/>
      <spec-citation spec="XQuery" section-number="3.1.2" section-title="Variable References" section-pointer="id-variables"/>
      <query name="vardeclwithtype-18" date="2005-11-23"/>
      <input-file role="principal-data" variable="input-context1">emptydoc</input-file>
      <expected-error>XQST0049</expected-error>
   </test-case>
   <test-case is-XPath2="false" name="vardeclwithtype-19" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="standard" Creator="Carmelo Montanez">
      <description>Evaluates declare variable feature with type that uses the fn:count function.</description>
      <spec-citation spec="XQuery" section-number="4.14" section-title="Variable Declaration" section-pointer="id-variable-declarations"/>
      <spec-citation spec="XQuery" section-number="3.1.2" section-title="Variable References" section-pointer="id-variables"/>
      <query name="vardeclwithtype-19" date="2005-11-23"/>
      <input-file role="principal-data" variable="input-context1">emptydoc</input-file>
      <output-file role="principal" compare="Text">vardeclwithtype-19.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="vardeclwithtype-20" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="standard" Creator="Carmelo Montanez">
      <description>Evaluates declare variable feature with type that uses the fn:string-length function.</description>
      <spec-citation spec="XQuery" section-number="4.14" section-title="Variable Declaration" section-pointer="id-variable-declarations"/>
      <spec-citation spec="XQuery" section-number="3.1.2" section-title="Variable References" section-pointer="id-variables"/>
      <query name="vardeclwithtype-20" date="2005-11-23"/>
      <input-file role="principal-data" variable="input-context1">emptydoc</input-file>
      <output-file role="principal" compare="Text">vardeclwithtype-20.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="vardeclwithtype-21" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="standard" Creator="Carmelo Montanez">
      <description>Evaluates declare variable feature with type that uses the fn:not function.</description>
      <spec-citation spec="XQuery" section-number="4.14" section-title="Variable Declaration" section-pointer="id-variable-declarations"/>
      <spec-citation spec="XQuery" section-number="3.1.2" section-title="Variable References" section-pointer="id-variables"/>
      <query name="vardeclwithtype-21" date="2005-11-23"/>
      <input-file role="principal-data" variable="input-context1">emptydoc</input-file>
      <output-file role="principal" compare="Text">vardeclwithtype-21.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="vardeclwithtype-22" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="standard" Creator="Carmelo Montanez">
      <description>Evaluates declare variable feature with type that uses the fn:empty function.</description>
      <spec-citation spec="XQuery" section-number="4.14" section-title="Variable Declaration" section-pointer="id-variable-declarations"/>
      <spec-citation spec="XQuery" section-number="3.1.2" section-title="Variable References" section-pointer="id-variables"/>
      <query name="vardeclwithtype-22" date="2005-11-23"/>
      <input-file role="principal-data" variable="input-context1">emptydoc</input-file>
      <output-file role="principal" compare="Text">vardeclwithtype-22.txt</output-file>
   </test-case>
   <test-case is-XPath2="false" name="internalvar-1" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="standard" Creator="Carmelo Montanez">
      <description>Evaluates an external variable named "$var" declared as "item()*" and multiple embedded comments.</description>
      <spec-citation spec="XQuery" section-number="4.14" section-title="Variable Declaration" section-pointer="id-variable-declarations"/>
      <spec-citation spec="XQuery" section-number="3.1.2" section-title="Variable References" section-pointer="id-variables"/>
      <query name="internalvar-1" date="2006-06-29"/>
      <input-file role="principal-data" variable="var">emptydoc</input-file>
      <output-file role="principal" compare="Text">internalvar-1.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-InternalVariablesWith-1" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="standard">
      <description>A variable declaration involving assignment and type declaration, and many comments.</description>
      <query name="K-InternalVariablesWith-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-InternalVariablesWith-1.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-InternalVariablesWith-2" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="standard">
      <description>A variable declaration involving assignment, and many comments.</description>
      <query name="K-InternalVariablesWith-2" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K-InternalVariablesWith-2.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-InternalVariablesWith-3" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="runtime-error">
      <description>A variable declaration whose source expression doesn't match the declared type, and where it typically is difficult to deduce statically.</description>
      <query name="K-InternalVariablesWith-3" 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-InternalVariablesWith-4" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="standard">
      <description>A variable declaration whose source expression doesn't match the declared type, and where it can be deduced statically.</description>
      <query name="K-InternalVariablesWith-4" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K-InternalVariablesWith-4.txt</output-file>
      <expected-error>XPTY0004</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-InternalVariablesWith-5" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="runtime-error">
      <description>A variable declaration whose source expression doesn't match the declared type, and where it can be deduced statically.</description>
      <query name="K-InternalVariablesWith-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="K-InternalVariablesWith-6" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="runtime-error">
      <description>A prolog variable depending on a variable which is not in scope, and the variable is not used.</description>
      <query name="K-InternalVariablesWith-6" 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-InternalVariablesWith-7" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="parse-error">
      <description>'declare variable' must be followed by '$'.</description>
      <query name="K-InternalVariablesWith-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-InternalVariablesWith-8" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="parse-error">
      <description>'=' cannot be used to assign values in 'declare variable', it must be ':='.</description>
      <query name="K-InternalVariablesWith-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-InternalVariablesWith-9" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="runtime-error">
      <description>A prolog variable depending on a variable which is not in scope.</description>
      <query name="K-InternalVariablesWith-9" 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-InternalVariablesWith-10" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="parse-error">
      <description>A namespace declaration must appear before a variable declaration, and its prefix is not inscope for the variable declaration.</description>
      <query name="K-InternalVariablesWith-10" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XPST0003</expected-error>
      <expected-error>XPST0081</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-InternalVariablesWith-11" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="standard">
      <description>One prolog variable initialized via another.</description>
      <query name="K-InternalVariablesWith-11" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <output-file role="principal" compare="Text">K-InternalVariablesWith-11.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-InternalVariablesWith-12" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="standard">
      <description>One prolog variable depending on a user function appearing after it.</description>
      <query name="K-InternalVariablesWith-12" static-name="K-InternalVariablesWith-12-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">K-InternalVariablesWith-12.txt</output-file>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-InternalVariablesWith-13" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="runtime-error">
      <description>One prolog variable depending on a user function, but where the user-specified types doesn't match.</description>
      <query name="K-InternalVariablesWith-13" 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-InternalVariablesWith-14" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="runtime-error">
      <description>One prolog variable depending on a user function, but where the types doesn't match.</description>
      <query name="K-InternalVariablesWith-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-InternalVariablesWith-15" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="runtime-error">
      <description>One prolog variable depending on itself.</description>
      <query name="K-InternalVariablesWith-15" 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-InternalVariablesWith-16" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="runtime-error">
      <description>A prolog variable having a circular dependency, stretching through many functions.</description>
      <query name="K-InternalVariablesWith-16" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XQST0054</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-InternalVariablesWith-17" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="runtime-error">
      <description>A prolog variable having a circular dependency, by having a variable reference in a call site argument. This is an error even though the variable isn't used, because implementations cannot skip reporting static errors.</description>
      <query name="K-InternalVariablesWith-17" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XQST0054</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-InternalVariablesWith-18" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="runtime-error">
      <description>A prolog variable having a circular dependency, by having a variable reference in a call site argument.</description>
      <query name="K-InternalVariablesWith-18" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XQST0054</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-InternalVariablesWith-19" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="runtime-error">
      <description>A prolog variable having a circular dependency, stretching through functions and variables.</description>
      <query name="K-InternalVariablesWith-19" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XQST0054</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K-InternalVariablesWith-20" FilePath="Expressions/PrologExpr/VariableProlog/InternalVariablesWith/" scenario="runtime-error">
      <description>A prolog variable having a circular dependency, stretching through functions and variables(#2).</description>
      <query name="K-InternalVariablesWith-20" date="2007-11-26+01:00"/>
      <input-file role="principal-data" variable="input-context">emptydoc</input-file>
      <expected-error>XQST0054</expected-error>
   </test-case>
   <test-case Creator="Frans Englich" is-XPath2="false" name="K2-InternalVariablesWith-1" FilePath="exprSeqTypes/PrologExpr/InternalVariablesWith/" scenario="runtime-error">
      <description>The query contains a type error despite the 'treat as' declaration.</description>
      <query name="K2-InternalVariablesWith-1" 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-group>