BUGS in MS Implementation of XmlSchema: Here we summarize bugs found in MS.NET, including some comment excerpt from Microsoft development team (as of 2004/07). 001. Does not allow duplicate values in lists for final* and block* attributes. For example "restriction restriction" is not allowed even though its a valid value for blockDefault. (MS: This is fixed in .NET 2.0) 002. Resets the minOccurs to 0 if maxOccurs="0", whereas it should raise an error. (MS: This WON'T be fixed in .NET 2.0. MS users may depend on this bug.) 003. Allows abstract="true" in the a localElement whereas it is not allowed. (MS: This is fixed in .NET 2.0) 004. QName value constraint When xs:QName based type is specified to an attribute or element declaration, MS.NET fails to fill their {value constraints} (i.e. default or fixed value), even though they have those namespace declaration by XmlSerializerNamespaces. (MS: This is fixed in .NET 2.0) 005. derivation by extension of xs:all As it is discussed on w3c xmlschema-dev ML, MS System.Xml.Schema incorrectly allows (i.e. XmlSchemaComplexContentExtension that contains XmlSchemaAll) whose base type contains non-empty particle. It is prohibited, because, as XML Schema structures 3.4.2 (complex content Schema Component) {content type} 2.3, complex content extension creates merged particles as a sequence, which never allows 'all' model group as its content. See: http://lists.w3.org/Archives/Public/xmlschema-dev/2002Oct/0156.html Below are incorrect W3C test suite in msxsdtest/complexType: ctH013.xsd, ctH019.xsd, ctH020.xsd, ctH021.xsd, ctH022.xsd, ctH023.xsd, ctJ001.xsd and in msxsdtest/ModelGroups: mgA016.xsd, mgO007.xsd (9 testcases). (MS: This is fixed in .NET 2.0) 006. xs:all minOccurs="0" not allowed W3C WXS Structures REC. says that model group xs:all is limited to have minOccurs=maxOccurs=1 in case of complexType's content type particle (see 3.8.6 All Group Limited), but this is corrected to allow minOccurs=0. (see E1-26 of http://www.w3.org/2001/05/xmlschema-errata#Errata1) Related msxsdtest is ParticlesEa022.xsd (MS: This happens only when a group ref targets to xs:all. This is bug.) 007. Insufficient unique particle attribution of xs:any MS.NET allows . Related msxsdtests are: ParticlesJd002.xsd, ParticlesJd003.xsd and ParticlesJd004.xsd. [Update] They are sequence not choice. Thus does not apply to this case. MS validator handles such schema as invalid correctly. ParticlesIb001.xsd is also related, but it is not necessarily said as incorrect. Both elements are of the same type, so *in a sense* they are the same declaration. MSV, XSV and I stands different. [Still on discussion on ParticlesIb001.xsd] 008. Occurence Range OK (3.9.6) incorrectly assessed [Update] MS team pointed out that it is incorrect and I found that XML Schema Structures 3.3.2 explicitly denotes that when minOccurs= maxOccurs=0 it corresponds to no component at all. Particles that have maxOccurs="0" looks simply ignored *before* evaluating particle restriction valid, but it might get incorrect result. Related msxsdtest is groupG001.xsd. 009. derived list incorrectly allowed "Type Derivation OK" by list simple type of atomic simple type is incorrectly assessed, when the list's {item type definition} (not {base type definition} ) can be assessed as "Type Derivation OK". MSV, XSV and Xerces is not designed to allow such type derivation, and I think they are more correct than MS. That is, MS's schema engine is designed to use such schema typed class like: public class Foo { int notAList; } Normally validates such xml into this class: 1 MS validator consequently allows such instance like: 1 2 3 But it cannot be validated into that class Foo. Related msxsdtests are elemT015.xsd and elemT022.xsd. (MS: This will be fixed in the next version of .NET 2.0) 010. derived union incorrectly allowed Similar problem to No.9 above resides in xs:union. Derived union type from atomic type is not naturally allowed. Related msxsdtest is elemT014.xsd. [ditto] 011. schema finalDefault with list and/or union [Update] This is not MS bug. We have to fix this problem. XML Schema errata corrected this part of the spec by allowing 'list'. In xs:schema, finalDefault = (#all | List of (extension | restriction)), but MS.NET failed to handle blockDefault='list' as an error. (union as well.) Related msxsdtest is stF034.xsd and stF036.xsd. 012. derived types cannot duplicate fixed facet If you have a facet like , you should be able to have in restrictions of it, as long as the values are the same. MS says: "Base type has {fixed} equal to true." XML-Schema part2 Datatype, 4.3.2.1: "If {fixed} is true, then types for which the current type is the {base type definition} cannot specify a value for minLength other than {value}." Which implies that you can specify a value for minLength that is the same as {value}. (MS: This is bug.) 013. Some facets are incorrectly allowed for list simple type. As to structures spec 3.14.6 Derivation Valid (Simple) 2.2, only length, minLength, maxLength, pattern and enumeration are allowed. However, MS implementation allows whitespace (and possibly and so on). (MS: "whitespace" is incorrectly allowed. It is bug.) 014. Incorrectly disallowed mixed derivation with empty content from elementOnly [Update] MS team pointed out that XSD Errata replaced -explicit content- with -effective content- . Thus, such schema should be rejected. (See E1-5 of http://www.w3.org/2001/05/xmlschema-errata .) When a complexType whose mixed='true' and -explicit content- is empty, and is derived from a complexType whose {content type} is ElementOnly, MS.NET rejects such schema. But 3.4.2 (complex content Schema Component) especially 2.1 of {content type} does not say it is an error. Related msxsdtest: ctF008.xsd 015. Included schema ignores incorrect element name which belongs to XmlSchema.Namespace MS Schema compiler fails to catch an error when an incorrect schema (such as below) is included by any other schemas: This does not apply to general compilation error such as missing sub components that should result in an error. This seems fixed in Whidbey.