BUG: Xsd.exe tool generates an incorrect class when the XML Schema has a group element in a choice element (815106)
The information in this article applies to:
- Microsoft Visual C# .NET (2003)
- Microsoft Visual C# .NET (2002)
- 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)
Beta Information This article discusses a Beta release of a Microsoft
product. The information in this article is provided as-is and is subject to
change without notice.
No formal product support is available from
Microsoft for this Beta product. For information about how to obtain support
for a Beta release, see the documentation that is included with the Beta
product files, or check the Web location from which you downloaded the release.
SYMPTOMSYou use a group element in a choice element in an XML Schema, and then use the XML Schema Definition Tool (Xsd.exe), to
generate a Visual C# .NET class or a Visual Basic .NET class. When you generate
the class, the code for the group and choice elements is not present in the generated class.WORKAROUNDTo work around this problem, do not use the group element in the choice element. Instead of using a group element in a choice element, add all the elements of the group element to the choice element. For example, for the schema that is described in step 5
of the "More Information" section, instead of the following: <s:group ref="s0:PersonalStats" /> use the following in step 5: <s:element name="Age" type="s:positiveInteger" />
<s:element name="Height" type="s:positiveInteger" />
<s:element name="Weight" type="s:positiveInteger" />
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 about XML Schemas, click the following article number to
view the article in the Microsoft Knowledge Base: 313826
INFO: Roadmap for XML Schemas in the .NET Framework
Modification Type: | Minor | Last Reviewed: | 9/15/2005 |
---|
Keywords: | kbvs2002sp1sweep kbBug kbNameSpace kbCodeGen kbSchema KB815106 kbAudDeveloper |
---|
|