[Bug 4401] [FS] validate strict expressions and err:XQDY0084

http://www.w3.org/Bugs/Public/show_bug.cgi?id=4401

           Summary: [FS] validate strict expressions and err:XQDY0084
           Product: XPath / XQuery / XSLT
           Version: Recommendation
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Formal Semantics
        AssignedTo: jmdyck@ibiblio.org
        ReportedBy: tim@cbcl.co.uk
         QAContact: public-qt-comments@w3.org


Consider a query similar to XQTS test validateexpr-23 in which an attempt is
made to validate an element which does not have a top-level schema declaration.


declare default element namespace "http://www.w3.org/XQueryTestOrderBy";

(: name : validateexpr-23 :)
(: description : Evaluation of a validate expression, whose operand node is a
ne
wly cosntructed top element :)
(: node for whom there is no declaration.:)

(: insert-start :)
import schema "http://www.w3.org/XQueryTestOrderBy";
declare variable $input-context1 external;
(: insert-end :)


let $var := validate strict { element DataValues1 {element Strings {"data"}}}
return $var

In this situation the error err:XQDY0084 should be flagged.  This condition is
detectable at type checking time when attempting to determine Type1 in:

statEnv |-  validate ValidationMode { Expr } : Type1

None of the rules of 8.6.1 Elements in validation mode apply (because there is
no top-level element definition and the validation mode is strict).  This
individates that the error condition XQDY0084 will occur.

However, XQDY0084 is a dynamic error and should only be raised when the
validate expression is executed.  This is illustrated by XQTS test
validateexpr-14.

Should a static typing implementation raise a static type checking exception in
this case or raise XQDY0084 during typechecking?

Received on Wednesday, 21 March 2007 08:31:45 UTC