BUGS-MS.txt 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. BUGS in MS Implementation of XmlSchema:
  2. Here we summarize bugs found in MS.NET, including some comment excerpt from
  3. Microsoft development team (as of 2004/07).
  4. 001. Does not allow duplicate values in lists for final* and block* attributes.
  5. For example "restriction restriction" is not allowed even though its a valid
  6. value for blockDefault.
  7. (MS: This is fixed in .NET 2.0)
  8. 002. Resets the minOccurs to 0 if maxOccurs="0", whereas it should raise an error.
  9. (MS: This WON'T be fixed in .NET 2.0. MS users may depend on this bug.)
  10. 003. Allows abstract="true" in the a localElement whereas it is not allowed.
  11. <?xml version="1.0"?>
  12. <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://xsdtesting" xmlns:x="http://xsdtesting" elementFormDefault="qualified">
  13. <xsd:element name="doc">
  14. <xsd:complexType>
  15. <xsd:sequence>
  16. <xsd:element name="elem1"/>
  17. <xsd:element abstract="true" name="elem2"/> <!--This element is not valid -->
  18. </xsd:sequence>
  19. </xsd:complexType>
  20. </xsd:element>
  21. </xsd:schema>
  22. (MS: This is fixed in .NET 2.0)
  23. 004. QName value constraint
  24. When xs:QName based type is specified to an attribute or element
  25. declaration, MS.NET fails to fill their {value constraints} (i.e.
  26. default or fixed value), even though they have those namespace
  27. declaration by XmlSerializerNamespaces.
  28. (MS: This is fixed in .NET 2.0)
  29. 005. derivation by extension of xs:all
  30. As it is discussed on w3c xmlschema-dev ML, MS System.Xml.Schema
  31. incorrectly allows <complexType><complexContent><extension><all>
  32. (i.e. XmlSchemaComplexContentExtension that contains XmlSchemaAll)
  33. whose base type contains non-empty particle. It is prohibited,
  34. because, as XML Schema structures 3.4.2 (complex content Schema
  35. Component) {content type} 2.3, complex content extension creates
  36. merged particles as a sequence, which never allows 'all' model group
  37. as its content.
  38. See: http://lists.w3.org/Archives/Public/xmlschema-dev/2002Oct/0156.html
  39. Below are incorrect W3C test suite in msxsdtest/complexType: ctH013.xsd,
  40. ctH019.xsd, ctH020.xsd, ctH021.xsd, ctH022.xsd, ctH023.xsd, ctJ001.xsd
  41. and in msxsdtest/ModelGroups: mgA016.xsd, mgO007.xsd (9 testcases).
  42. (MS: This is fixed in .NET 2.0)
  43. 006. xs:all minOccurs="0" not allowed
  44. W3C WXS Structures REC. says that model group xs:all is limited to have
  45. minOccurs=maxOccurs=1 in case of complexType's content type particle
  46. (see 3.8.6 All Group Limited), but this is corrected to allow
  47. minOccurs=0.
  48. (see E1-26 of http://www.w3.org/2001/05/xmlschema-errata#Errata1)
  49. Related msxsdtest is ParticlesEa022.xsd
  50. (MS: This happens only when a group ref targets to xs:all. This is bug.)
  51. 007. Insufficient unique particle attribution of xs:any
  52. MS.NET allows <xs:choice><xs:any /><xs:element ... /></xs:choice>.
  53. <del>
  54. Related msxsdtests are: ParticlesJd002.xsd, ParticlesJd003.xsd and
  55. ParticlesJd004.xsd.
  56. </del>
  57. [Update] They are sequence not choice. Thus does not apply to this
  58. case. MS validator handles such schema as invalid correctly.
  59. ParticlesIb001.xsd is also related, but it is not necessarily said as
  60. incorrect. Both elements are of the same type, so *in a sense* they are
  61. the same declaration. MSV, XSV and I stands different.
  62. [Still on discussion on ParticlesIb001.xsd]
  63. <del>008. Occurence Range OK (3.9.6) incorrectly assessed</del>
  64. [Update] MS team pointed out that it is incorrect and I found that
  65. XML Schema Structures 3.3.2 explicitly denotes that when minOccurs=
  66. maxOccurs=0 it corresponds to no component at all.
  67. Particles that have maxOccurs="0" looks simply ignored *before*
  68. evaluating particle restriction valid, but it might get incorrect
  69. result.
  70. <xsd:complexType name="foo">
  71. <xsd:complexContent>
  72. <xsd:restriction base="bar">
  73. <xsd:choice>
  74. <xsd:element name="e1" minOccurs="0" maxOccurs="0"/>
  75. <xsd:element name="e2"/>
  76. </xsd:choice>
  77. </xsd:restriction>
  78. </xsd:complexContent>
  79. </xsd:complexType>
  80. <xsd:complexType name="bar">
  81. <xsd:choice>
  82. <xsd:element name="e1"/>
  83. <xsd:element name="e2"/>
  84. </xsd:choice>
  85. </xsd:complexType>
  86. Related msxsdtest is groupG001.xsd.
  87. 009. derived list incorrectly allowed
  88. "Type Derivation OK" by list simple type of atomic simple type is
  89. incorrectly assessed, when the list's {item type definition} (not
  90. {base type definition} ) can be assessed as "Type Derivation OK". MSV,
  91. XSV and Xerces is not designed to allow such type derivation, and I
  92. think they are more correct than MS. That is, MS's schema engine is
  93. designed to use such schema typed class like:
  94. public class Foo { int notAList; }
  95. Normally validates such xml into this class:
  96. <Foo>1</Foo>
  97. MS validator consequently allows such instance like:
  98. <foo xsi:type="int_list_type">1 2 3</foo>
  99. But it cannot be validated into that class Foo.
  100. Related msxsdtests are elemT015.xsd and elemT022.xsd.
  101. (MS: This will be fixed in the next version of .NET 2.0)
  102. 010. derived union incorrectly allowed
  103. Similar problem to No.9 above resides in xs:union. Derived union type
  104. from atomic type is not naturally allowed.
  105. Related msxsdtest is elemT014.xsd.
  106. [ditto]
  107. <del>011. schema finalDefault with list and/or union</del>
  108. [Update] This is not MS bug. We have to fix this problem. XML Schema
  109. errata corrected this part of the spec by allowing 'list'.
  110. In xs:schema, finalDefault = (#all | List of (extension | restriction)),
  111. but MS.NET failed to handle blockDefault='list' as an error.
  112. (union as well.)
  113. Related msxsdtest is stF034.xsd and stF036.xsd.
  114. 012. derived types cannot duplicate fixed facet
  115. If you have a facet like <xsd:minLength value="5" fixed="true" />,
  116. you should be able to have <xsd:minLength value="5" /> in
  117. restrictions of it, as long as the values are the same. MS says:
  118. "Base type has {fixed} equal to true."
  119. XML-Schema part2 Datatype, 4.3.2.1:
  120. "If {fixed} is true, then types for which the current type is the
  121. {base type definition} cannot specify a value for minLength other than
  122. {value}."
  123. Which implies that you can specify a value for minLength that is the
  124. same as {value}.
  125. (MS: This is bug.)
  126. 013. Some facets are incorrectly allowed for list simple type.
  127. As to structures spec 3.14.6 Derivation Valid (Simple) 2.2, only length,
  128. minLength, maxLength, pattern and enumeration are allowed. However, MS
  129. implementation allows whitespace (and possibly and so on).
  130. (MS: "whitespace" is incorrectly allowed. It is bug.)
  131. <del>014. Incorrectly disallowed mixed derivation with empty content from
  132. elementOnly</del>
  133. [Update] MS team pointed out that XSD Errata replaced -explicit
  134. content- with -effective content- . Thus, such schema should be
  135. rejected. (See E1-5 of http://www.w3.org/2001/05/xmlschema-errata .)
  136. When a complexType whose mixed='true' and -explicit content- is empty,
  137. and is derived from a complexType whose {content type} is ElementOnly,
  138. MS.NET rejects such schema. But 3.4.2 (complex content Schema
  139. Component) especially 2.1 of {content type} does not say it is an error.
  140. Related msxsdtest: ctF008.xsd
  141. 015. Included schema ignores incorrect element name which belongs to
  142. XmlSchema.Namespace
  143. MS Schema compiler fails to catch an error when an incorrect schema
  144. (such as below) is included by any other schemas:
  145. <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'>
  146. <xs:foo />
  147. </xs:schema>
  148. This does not apply to general compilation error such as missing
  149. sub components that should result in an error.
  150. This seems fixed in Whidbey.