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 16161 - disallowedSubst00503m3,4,5 should be invalid for XSD 1.1
Summary: disallowedSubst00503m3,4,5 should be invalid for XSD 1.1
Status: NEW
Alias: None
Product: XML Schema Test Suite
Classification: Unclassified
Component: Sun Tests (show other bugs)
Version: 2006-11-06
Hardware: All Windows 3.1
: P2 normal
Target Milestone: ---
Assignee: C. M. Sperberg-McQueen
QA Contact: XML Schema Test Suite mailing list
URL:
Whiteboard:
Keywords: decided
Depends on:
Blocks:
 
Reported: 2012-02-29 16:58 UTC by Andreas Meissl
Modified: 2012-12-04 00:52 UTC (History)
2 users (show)

See Also:


Attachments

Description Andreas Meissl 2012-02-29 16:58:25 UTC
In my opinion the expected result of the test cases disallowedSubst00503m3, disallowedSubst00503m4 and disallowedSubst00503m5 of set ElemDecl should be invalid for XSD 1.1 because they violate clause 4 of Schema Component Constraint: Element Declaration Properties Correct.

As described in http://www.w3.org/TR/xmlschema11-1/#key-val-sub-type a complex type definition S is validly substitutable for another complex type definition T if: "S is validly derived from T subject to the blocking keywords in the union of K and T. {prohibited substitutions}, as defined in Type Derivation OK (Complex) (ยง3.4.6.5)"

So in difference to XSD 1.0 this also considers the prohibited substitutions of T (i.e. the value of the block attribute of the complex type definition "Type" in the concrete examples).
Comment 1 David Ezell 2012-04-13 15:52:42 UTC
Needs further research.
Once the test suite is in its new location this research will be easier.
Comment 2 Michael Kay 2012-04-13 17:04:32 UTC
I agree with Andreas. The spec has been deliberately changed. In XSD 1.0 you were allowed to say that Member1 is in the substitution group of Head, but saying this had no effect, so the instance is invalid. In XSD 1.1 we've changed it so instead of being ineffective, it's an error. (Saxon issues a warning at schema processing time; the code that issues this warning carries a comment which could be interpreted as slanderous.)
Comment 3 Michael Kay 2012-04-20 22:41:28 UTC
As far as I can see the same reasoning also makes the following invalid:

disallowedSubst00105m
disallowedSubst00106m2
disallowedSubst00501m2
disallowedSubst00502m3
disallowedSubst00502m4
Comment 4 Michael Kay 2012-04-20 22:53:50 UTC
To try and sum up my reading of the current rules in ordinary English:

(a) if you declare an element M as being in the substitution group of H, and H
blocks substitution, that's not in itself an error, it just means M can't be
substituted for H.

(b) however, if the type of M is not substitutable for the type of H, perhaps
because either H or the type of H blocks substitution (or
restriction|extension, if the type of M is a restriction|extension), that is an
error - it makes the schema invalid. This is the case that has changed since
1.0.

I suppose it's pointless to ask why the distinction?
Comment 5 Michael Kay 2012-04-25 20:17:05 UTC
Other affected tests in the Microsoft ElementDecl test set:

elemT062
elemT063
elemT064
elemT065
elemT066
elemT077
Comment 6 Michael Kay 2012-04-26 14:33:19 UTC
Test msData/additional/addB114.xsd has the same problem.
Comment 7 David Ezell 2012-05-04 16:22:58 UTC
Resolved: change the outcome of the listed tests to invalid for 1.1.