BUG: The elementFormDefault and attributeFormDefault properties of XSD schema are incorrect when they are read from the designer (316798)
The information in this article applies to:
- Microsoft Visual Basic .NET (2002)
- Microsoft Visual Basic .NET (2003)
- Microsoft XML Classes (included with the .NET Framework 1.0)
- Microsoft XML Classes (included with the .NET Framework 1.1)
This article was previously published under Q316798 SYMPTOMS When you use the XSDSchema designer tool to create an XSD
schema, the elementFormDefault and attributeFormDefault properties are read incorrectly by the designer. CAUSE The Msdatasetgenerator custom tool generates a DataSet that is used to get the XML schema. The DataSet does not preserve the elementFormDefault and attributeFormDefault properties. RESOLUTION Load the created file directly into the XMLSchema object instead of using the designer object to get the schema;
the following code accomplishes this:
Dim fs As FileStream
Dim schema As XmlSchema
fs = New FileStream("book.xsd", FileMode.Open)
schema = XmlSchema.Read(fs, New ValidationEventHandler(AddressOf ShowCompileError))
'Validation Event handler.
Public Sub ShowCompileError(ByVal sender As Object, ByVal e As ValidationEventArgs)
Console.WriteLine("Validation Error: {0}", e.Message)
End Sub
STATUSMicrosoft has confirmed that this is a bug in the Microsoft
products that are listed at the beginning of this article.
Modification Type: | Minor | Last Reviewed: | 9/15/2005 |
---|
Keywords: | kbvs2002sp1sweep kbbug kbpending KB316798 |
---|
|