This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 29370 - Optional Operand for Validate Expression
Summary: Optional Operand for Validate Expression
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3.1 (show other bugs)
Version: Candidate Recommendation
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Jonathan Robie
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-12 18:16 UTC by Josh Spiegel
Modified: 2016-01-22 09:28 UTC (History)
1 user (show)

See Also:


Attachments

Description Josh Spiegel 2016-01-12 18:16:38 UTC
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 

> [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 

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]. 

The specification needs to clarify what it means if the operand is absent.

Once the specification is updated, it is likely one of the following groups of tests will also need to be updated:

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

This group expects the validate expression to return empty when absent.  The next group expects XQTY0030 when the input is empty:

   K-CombinedErrorCodes-10 
   XQTY0030 
   qischema90171-err
Comment 1 Andrew Coleman 2016-01-22 09:28:11 UTC
At the teleconference on 2016-01-12, the WG decided to resolve this by changing the grammar to make 'validate { }' a syntax error, and fixup the tests accordingly.