Bug: XmlValidatingReader Ignores the Schema Nillable and the XML Nill Attributes (814177)
The information in this article applies to:
- Microsoft XML Classes (included with the .NET Framework 1.0)
SYMPTOMSWhen you validate an empty XML instance document by using XmlValidatingReader, you may receive the following error message: Element 'ElementName' has incomplete
content. Expected 'Employee'. An error occurred at file
:///FileName. Where ElementName
is the name of an empty element, and where FileName
is the name of the XML instance document. You receive the error message even
though in the schema file, the element has the nillable attribute set to true, and has a complex content. Additionally, the empty element in
the instance document has the nill attribute set to true. The XmlValidatingReader ignores the nillable and nill attributes, and throws the error. STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are
listed at the beginning of this article.
REFERENCES For additional information, click the following article
numbers to view the articles in the Microsoft Knowledge Base: 308064
HOW TO: Persist an ADO.NET DataSet as XML by Using Visual Basic .NET
309183 HOW TO: Persist an ADO.NET DataSet as XML by Using Visual C# .NET
317595 HOW TO: Validate an XML Document by Using Multiple Schemas in Visual Basic .NET
318505 HOW TO: Validate an XML Document by Using Multiple Schemas in Visual C# .NET
Idea SectionThe sample code works in .NET Framework version 1.1 without
any change. Please add Microsoft .NET Framework Class Libraries 1.1 to the
applies to section after .NET Framework 1.1 is released. Use contents of Article: 326604 BUG: XSD validation fails on the DataSet with empty table for writing this article
Modification Type: | Major | Last Reviewed: | 9/22/2003 |
---|
Keywords: | kberrmsg kbValidation kbNameSpace kbbug KB814177 kbAudDeveloper |
---|
|