Optional Operand for Validate Expression

The grammar for ValidateExpr was recently changed so that the operand expression is optional:
https://www.w3.org/XML/Group/qtspecs/specifications/xquery-31/html/xquery-31.html#id-validate <https://www.w3.org/XML/Group/qtspecs/specifications/xquery-31/html/xquery-31.html#id-validate>

> [102]    ValidateExpr    ::=    "validate" (ValidationMode | ("type" TypeName))? EnclosedExpr
> [103]    ValidationMode    ::=    "lax" | "strict"
> [36]    EnclosedExpr    ::=    "{" Expr? "}"



Here is a relevant bug: 
https://www.w3.org/Bugs/Public/show_bug.cgi?id=29185 <https://www.w3.org/Bugs/Public/show_bug.cgi?id=29185>

Here is a relevant decision from meeting #621 on 10/27/2015:

> DECISION: WG has agreed to refactor the grammar using the EnclosedExpr in the node constructors, but in the case of the element constructor we shall not use it in the first argument because it cannot be an empty sequence.  Consider the expressions Try, Catch, Validate, ExtensionExpr, Ordered and Unordered, CompDocConstructor, CompAttrConstructor, CompTextConstructor, CompCommentConstructor CompPIConstructor and Namespace


Currently XQuery 3.1 says the following: 

> If the operand of a validate expression does not evaluate to exactly one document or element node, a type error is raised [err:XQTY0030]. 

According to this, for example, “validate { } “ would raise XQTY0030.  However, some recently written tests indicate it should not raise an error:

    K-CombinedErrorCodes-13a 
    K-CombinedErrorCodes-14a 
    K-CombinedErrorCodes-15a 

A few older tests still expect an error in this case:

   K-CombinedErrorCodes-10 
   XQTY0030 
   qischema90171-err 

Unfortunately I wasn’t able to attend meeting #621.  Does anybody remember what the decision on this was?

Thanks,
Josh

Received on Monday, 11 January 2016 20:03:41 UTC