- From: <bugzilla@wiggum.w3.org>
- Date: Fri, 08 Sep 2006 04:09:24 +0000
- To: www-xml-schema-comments@w3.org
- CC:
http://www.w3.org/Bugs/Public/show_bug.cgi?id=3673 Summary: revisit (and enlarge) XPath subset for assertions? Product: XML Schema Version: 1.1 only Platform: Macintosh OS/Version: All Status: NEW Severity: normal Priority: P2 Component: Structures: XSD Part 1 AssignedTo: cmsmcq@w3.org ReportedBy: cmsmcq@w3.org QAContact: www-xml-schema-comments@w3.org Thinking about some of our use cases for check clauses the other day, I became slightly more concerned than I had been by the restrictions placed on the XPath expressions of assertions in our current working draft. The use cases provide the following examples of XPath expressions for 'high priority' use cases. Those marked * are not legal according to the grammar in our most recent public working draft. Some variations on them, which do not appear in the wiki, some of which are intended to have the same semantics when used as assertions and some of which are intended to illustrate syntactic limits on the existing grammar, are also given, marked + (or +* if they are not accepted by the grammar). It's possible that my parser is faulty, so first of all I ask those interested to see if they agree with me about which of these XPath expressions are accepted, and which are not accepted, by our current XPath subset. Value-equals test required (1) * @type='BridgeEthernet' & @BrEthernetIP = '' +* @type='BridgeEthernet' and @BrEthernetIP = '' +* @type eq 'BridgeEthernet' and @BrEthernetIP eq '' + @type eq xsd:string('BridgeEthernet') and @BrEthernetIP eq xsd:string('') * ./@type='BridgedEthernet' + ./@type eq xsd:string('BridgedEthernet') * ./@type='BridgedEthernet' and not ./@BrEthernetIP +* ./@type eq xsd:string('BridgedEthernet') and not ./@BrEthernetIP +* ./@type eq xsd:string('BridgedEthernet') and not(./@BrEthernetIP) + ./@type eq xsd:string('BridgedEthernet') and ./@BrEthernetIP Value arithmetic required - attributes (2) * @min <= @max + @min le @max * . < ../@min * . le ../@min * @max >= @min + @max ge @min Constraints on grandchildren (5) Simple attribute implication (6) * ./@attrOne or not(./@attrTwo) * ./@attrOne or not ./@attrTwo + ./@attrOne or ./@attrTwo ./@attrOne * not(./@attrOne) * ./@attrTwo and not(@attrOne) Attribute mutex (7) * (./@dec or ./@hex) and not(./@dec and ./@hex) +* (./@dec or ./@hex) and (./@dec and ./@hex) +* (./@dec or ./@hex) + ./@dec or ./@hex ./@dec and ./@hex +* (./@dec and ./@hex) * not(./@dec) and not(./@hex) Open content, sort of (9) Value arithmetic required - elements (12) * (./a + ./b + ./c) <= 30 +* (./a + ./b + ./c) le 30 +* ./a <= 30 +* ./a le 30 +* ./a le xsd:int(30) + ./a le xsd:int('30') * ./a + ./b + ./c > 30.00 Require somewhere (20) * count(//buyer) > 0 +* count(//buyer) gt 0 +* count(//buyer) gt xsd:int('0') +* count(//buyer) * count(//buyer-id | //buyer/@id) > 0 * count(//seller) > 0 * count(//seller-id | //seller/@id) > 0 * count(//binding-jurisdiction) = 1 * count(//severability | //nonseverability) = 1 * count(//start-date) = 1 and count(//end-date) = 1 Deep inclusions (23) * not(ancestor::html:form) * not(.//html:input[not(./ancestor::html:form]) * count(.//html:input[ancestor::html:form]) = count(.//html:input) * count(.//html:form//html:input) = count(.//html:input) I think the bottom line is (a) either the grammar or my parser is having some trouble with not() and count(), and (b) that if my parser is correct then our subset is too small, because it makes it too hard to write useful assertions.
Received on Friday, 8 September 2006 04:09:35 UTC