Microsoft KB Archive/816226: Difference between revisions

From BetaArchive Wiki
m (Text replacement - "<" to "<")
m (Text replacement - ">" to ">")
 
Line 56: Line 56:


There is no direct workaround for this problem. However, in some cases you can work around this problem by using two choice elements. The first choice element has members with the '''maxOccur''' attribute set to one, and the second choice element has members with a '''maxOccur''' attribute that is set to greater than one. The following schema code describes the changes that are required in choice elements of the schema that are used in the &quot;More Information&quot; section of this article:
There is no direct workaround for this problem. However, in some cases you can work around this problem by using two choice elements. The first choice element has members with the '''maxOccur''' attribute set to one, and the second choice element has members with a '''maxOccur''' attribute that is set to greater than one. The following schema code describes the changes that are required in choice elements of the schema that are used in the &quot;More Information&quot; section of this article:
<pre class="codesample"><?xml version=&quot;1.0&quot; ?&gt;
<pre class="codesample"><?xml version=&quot;1.0&quot; ?>
<xs:schema id=&quot;Root&quot; targetNamespace=&quot;http://tempuri.org/customer.xsd&quot; xmlns:mstns=&quot;http://tempuri.org/customer.xsd&quot; xmlns=&quot;http://tempuri.org/customer.xsd&quot; xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:msdata=&quot;urn:schemas-microsoft-com:xml-msdata&quot; attributeFormDefault=&quot;qualified&quot; elementFormDefault=&quot;qualified&quot;&gt;
<xs:schema id=&quot;Root&quot; targetNamespace=&quot;http://tempuri.org/customer.xsd&quot; xmlns:mstns=&quot;http://tempuri.org/customer.xsd&quot; xmlns=&quot;http://tempuri.org/customer.xsd&quot; xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:msdata=&quot;urn:schemas-microsoft-com:xml-msdata&quot; attributeFormDefault=&quot;qualified&quot; elementFormDefault=&quot;qualified&quot;>
     <xs:element name=&quot;Root&quot; msdata:IsDataSet=&quot;true&quot; msdata:EnforceConstraints=&quot;False&quot;&gt;
     <xs:element name=&quot;Root&quot; msdata:IsDataSet=&quot;true&quot; msdata:EnforceConstraints=&quot;False&quot;>
         <xs:complexType&gt;
         <xs:complexType>
             <xs:choice maxOccurs=&quot;unbounded&quot;&gt;
             <xs:choice maxOccurs=&quot;unbounded&quot;>
                 <xs:element name=&quot;Customers&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot;&gt;
                 <xs:element name=&quot;Customers&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot;>
                     <xs:complexType&gt;
                     <xs:complexType>
                         <xs:sequence&gt;
                         <xs:sequence>
                           <xs:choice minOccurs=&quot;0&quot;&gt;
                           <xs:choice minOccurs=&quot;0&quot;>
                               <xs:element name=&quot;workphone&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot; /&gt;
                               <xs:element name=&quot;workphone&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot; />
                             </xs:choice&gt;
                             </xs:choice>
                             <xs:choice minOccurs=&quot;0&quot;&gt;
                             <xs:choice minOccurs=&quot;0&quot;>
                                 <xs:element name=&quot;homephone&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot; /&gt;
                                 <xs:element name=&quot;homephone&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot; />
                                 <xs:element name=&quot;cellphone&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot; /&gt;
                                 <xs:element name=&quot;cellphone&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot; />
                             </xs:choice&gt;
                             </xs:choice>
                             <xs:element name=&quot;CustName&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot; /&gt;
                             <xs:element name=&quot;CustName&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot; />
                             <xs:element name=&quot;CustID&quot; type=&quot;xs:string&quot; /&gt;
                             <xs:element name=&quot;CustID&quot; type=&quot;xs:string&quot; />
                         </xs:sequence&gt;
                         </xs:sequence>
                     </xs:complexType&gt;
                     </xs:complexType>
                 </xs:element&gt;
                 </xs:element>
             </xs:choice&gt;
             </xs:choice>
         </xs:complexType&gt;
         </xs:complexType>
         <xs:key name=&quot;RootKey1&quot;&gt;
         <xs:key name=&quot;RootKey1&quot;>
             <xs:selector xpath=&quot;.//mstns:Customers&quot; /&gt;
             <xs:selector xpath=&quot;.//mstns:Customers&quot; />
             <xs:field xpath=&quot;mstns:CustID&quot; /&gt;
             <xs:field xpath=&quot;mstns:CustID&quot; />
         </xs:key&gt;
         </xs:key>
     </xs:element&gt;
     </xs:element>
</xs:schema&gt;</pre>
</xs:schema></pre>


</div>
</div>
Line 160: Line 160:
<li>Under '''Categories''', click '''General''', and then under '''Templates''', click '''XML Schema'''. Click '''Open'''.</li>
<li>Under '''Categories''', click '''General''', and then under '''Templates''', click '''XML Schema'''. Click '''Open'''.</li>
<li><p>Click the '''XML''' tab. Replace the existing code with the following XML Schema code:</p>
<li><p>Click the '''XML''' tab. Replace the existing code with the following XML Schema code:</p>
<pre class="codesample"><?xml version=&quot;1.0&quot; ?&gt;
<pre class="codesample"><?xml version=&quot;1.0&quot; ?>
<xs:schema id=&quot;Root&quot; targetNamespace=&quot;http://tempuri.org/customer.xsd&quot; xmlns:mstns=&quot;http://tempuri.org/customer.xsd&quot; xmlns=&quot;http://tempuri.org/customer.xsd&quot; xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:msdata=&quot;urn:schemas-microsoft-com:xml-msdata&quot; attributeFormDefault=&quot;qualified&quot; elementFormDefault=&quot;qualified&quot;&gt;
<xs:schema id=&quot;Root&quot; targetNamespace=&quot;http://tempuri.org/customer.xsd&quot; xmlns:mstns=&quot;http://tempuri.org/customer.xsd&quot; xmlns=&quot;http://tempuri.org/customer.xsd&quot; xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:msdata=&quot;urn:schemas-microsoft-com:xml-msdata&quot; attributeFormDefault=&quot;qualified&quot; elementFormDefault=&quot;qualified&quot;>
     <xs:element name=&quot;Root&quot; msdata:IsDataSet=&quot;true&quot; msdata:EnforceConstraints=&quot;False&quot;&gt;
     <xs:element name=&quot;Root&quot; msdata:IsDataSet=&quot;true&quot; msdata:EnforceConstraints=&quot;False&quot;>
         <xs:complexType&gt;
         <xs:complexType>
             <xs:choice maxOccurs=&quot;unbounded&quot;&gt;
             <xs:choice maxOccurs=&quot;unbounded&quot;>
                 <xs:element name=&quot;Customers&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot;&gt;
                 <xs:element name=&quot;Customers&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot;>
                     <xs:complexType&gt;
                     <xs:complexType>
                         <xs:sequence&gt;
                         <xs:sequence>
                             <xs:choice minOccurs=&quot;0&quot;&gt;
                             <xs:choice minOccurs=&quot;0&quot;>
                                 <xs:element name=&quot;workphone&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot; /&gt;
                                 <xs:element name=&quot;workphone&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot; />
                                 <xs:element name=&quot;homephone&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot; /&gt;
                                 <xs:element name=&quot;homephone&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot; />
                                 <xs:element name=&quot;cellphone&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot; /&gt;
                                 <xs:element name=&quot;cellphone&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot; />
                             </xs:choice&gt;
                             </xs:choice>
                             <xs:element name=&quot;CustName&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot; /&gt;
                             <xs:element name=&quot;CustName&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot; />
                             <xs:element name=&quot;CustID&quot; type=&quot;xs:string&quot; /&gt;
                             <xs:element name=&quot;CustID&quot; type=&quot;xs:string&quot; />
                         </xs:sequence&gt;
                         </xs:sequence>
                     </xs:complexType&gt;
                     </xs:complexType>
                 </xs:element&gt;
                 </xs:element>
             </xs:choice&gt;
             </xs:choice>
         </xs:complexType&gt;
         </xs:complexType>
         <xs:key name=&quot;RootKey1&quot;&gt;
         <xs:key name=&quot;RootKey1&quot;>
             <xs:selector xpath=&quot;.//mstns:Customers&quot; /&gt;
             <xs:selector xpath=&quot;.//mstns:Customers&quot; />
             <xs:field xpath=&quot;mstns:CustID&quot; /&gt;
             <xs:field xpath=&quot;mstns:CustID&quot; />
         </xs:key&gt;
         </xs:key>
     </xs:element&gt;
     </xs:element>
</xs:schema&gt;</pre></li>
</xs:schema></pre></li>
<li>On the '''File''' menu, click '''Save XMLSchema1 As'''.</li>
<li>On the '''File''' menu, click '''Save XMLSchema1 As'''.</li>
<li>Name the file <span class="kbd userinput"> C:\MyTestConsoleApplication\customers.xsd</span>, and then click '''Save'''.</li>
<li>Name the file <span class="kbd userinput"> C:\MyTestConsoleApplication\customers.xsd</span>, and then click '''Save'''.</li>
Line 191: Line 191:
<li>Under '''Categories''', click '''General''', and then under '''Templates''', click '''XML File'''. Click '''Open'''.</li>
<li>Under '''Categories''', click '''General''', and then under '''Templates''', click '''XML File'''. Click '''Open'''.</li>
<li><p>Click the '''XML''' tab. Replace the existing code with the following XML code:</p>
<li><p>Click the '''XML''' tab. Replace the existing code with the following XML code:</p>
<pre class="codesample"><?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
<pre class="codesample"><?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?>
<Root xmlns=&quot;http://tempuri.org/customer.xsd&quot;&gt;
<Root xmlns=&quot;http://tempuri.org/customer.xsd&quot;>
   <Customers&gt;
   <Customers>
       <cellphone&gt;9887858</cellphone&gt;
       <cellphone>9887858</cellphone>
       <cellphone&gt;4645645</cellphone&gt;
       <cellphone>4645645</cellphone>
       <homephone&gt;8743857</homephone&gt;
       <homephone>8743857</homephone>
       <homephone&gt;2345678</homephone&gt;
       <homephone>2345678</homephone>
       <CustName&gt;3saqib2</CustName&gt;
       <CustName>3saqib2</CustName>
       <CustID&gt;32</CustID&gt;
       <CustID>32</CustID>
   </Customers&gt;
   </Customers>
   <Customers&gt;
   <Customers>
       <homephone&gt;8763857</homephone&gt;
       <homephone>8763857</homephone>
       <cellphone&gt;9876543</cellphone&gt;
       <cellphone>9876543</cellphone>
       <CustName&gt;Mian</CustName&gt;
       <CustName>Mian</CustName>
       <CustID&gt;2</CustID&gt;
       <CustID>2</CustID>
   </Customers&gt;
   </Customers>
</Root&gt;</pre></li>
</Root></pre></li>
<li>On the '''File''' menu, click '''Save XMLFile1 As'''.</li>
<li>On the '''File''' menu, click '''Save XMLFile1 As'''.</li>
<li>Name the file <span class="kbd userinput"> C:\MyTestConsoleApplication\customers.xml</span>, and then click '''Save'''.</li>
<li>Name the file <span class="kbd userinput"> C:\MyTestConsoleApplication\customers.xml</span>, and then click '''Save'''.</li>
Line 225: Line 225:
<li>Press ENTER to close the console.</li>
<li>Press ENTER to close the console.</li>
<li><p>In XMLSchema1.xsd, locate the following choice element:</p>
<li><p>In XMLSchema1.xsd, locate the following choice element:</p>
<pre class="codesample">                            <xs:choice minOccurs=&quot;0&quot;&gt;
<pre class="codesample">                            <xs:choice minOccurs=&quot;0&quot;>
                                 <xs:element name=&quot;workphone&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot; /&gt;
                                 <xs:element name=&quot;workphone&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot; />
                                 <xs:element name=&quot;homephone&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot; /&gt;
                                 <xs:element name=&quot;homephone&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot; />
                                 <xs:element name=&quot;cellphone&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot; /&gt;
                                 <xs:element name=&quot;cellphone&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot; />
                             </xs:choice&gt;</pre>
                             </xs:choice></pre>
<p>Replace the choice element with the following choice elements:</p>
<p>Replace the choice element with the following choice elements:</p>
<pre class="codesample">                        <xs:choice minOccurs=&quot;0&quot;&gt;
<pre class="codesample">                        <xs:choice minOccurs=&quot;0&quot;>
                               <xs:element name=&quot;workphone&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot; /&gt;
                               <xs:element name=&quot;workphone&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot; />
                             </xs:choice&gt;
                             </xs:choice>
                             <xs:choice minOccurs=&quot;0&quot;&gt;
                             <xs:choice minOccurs=&quot;0&quot;>
                                 <xs:element name=&quot;homephone&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot; /&gt;
                                 <xs:element name=&quot;homephone&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot; />
                                 <xs:element name=&quot;cellphone&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot; /&gt;
                                 <xs:element name=&quot;cellphone&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot; />
                             </xs:choice&gt;</pre></li>
                             </xs:choice></pre></li>
<li>On the '''Debug''' menu, click '''Start'''.</li></ol>
<li>On the '''Debug''' menu, click '''Start'''.</li></ol>



Latest revision as of 10:21, 21 July 2020

Article ID: 816226

Article Last Modified on 9/15/2005



APPLIES TO

  • Microsoft .NET Framework 1.1
  • Microsoft .NET Framework 1.0
  • Microsoft Visual Basic .NET 2003 Standard Edition
  • Microsoft Visual Basic .NET 2002 Standard Edition
  • Microsoft Visual C# .NET 2003 Standard Edition
  • Microsoft Visual C# .NET 2002 Standard Edition



SYMPTOMS

In an XML Schema project, the XSD tool incorrectly interprets the maxOccurs attribute for all members of the choice element as unbounded if one of the following criteria is true:

  • If the maxOccurs attribute is set to a value that is greater than 1.
  • If the maxOccurs attribute is unbounded for at least one member of the choice element.

With the managed class that is generated by the XSD tool, multiple unbounded entries can be added for all the members of the choice element in the XML document.

WORKAROUND

There is no direct workaround for this problem. However, in some cases you can work around this problem by using two choice elements. The first choice element has members with the maxOccur attribute set to one, and the second choice element has members with a maxOccur attribute that is set to greater than one. The following schema code describes the changes that are required in choice elements of the schema that are used in the "More Information" section of this article:

<?xml version="1.0" ?>
<xs:schema id="Root" targetNamespace="http://tempuri.org/customer.xsd" xmlns:mstns="http://tempuri.org/customer.xsd" xmlns="http://tempuri.org/customer.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" attributeFormDefault="qualified" elementFormDefault="qualified">
    <xs:element name="Root" msdata:IsDataSet="true" msdata:EnforceConstraints="False">
        <xs:complexType>
            <xs:choice maxOccurs="unbounded">
                <xs:element name="Customers" minOccurs="0" maxOccurs="unbounded">
                    <xs:complexType>
                        <xs:sequence>
                           <xs:choice minOccurs="0">
                              <xs:element name="workphone" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
                            </xs:choice>
                            <xs:choice minOccurs="0">
                                <xs:element name="homephone" type="xs:string" minOccurs="0" />
                                <xs:element name="cellphone" type="xs:string" minOccurs="0" />
                            </xs:choice>
                            <xs:element name="CustName" type="xs:string" minOccurs="0" />
                            <xs:element name="CustID" type="xs:string" />
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:choice>
        </xs:complexType>
        <xs:key name="RootKey1">
            <xs:selector xpath=".//mstns:Customers" />
            <xs:field xpath="mstns:CustID" />
        </xs:key>
    </xs:element>
</xs:schema>

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce the Behavior

  1. Start Microsoft Visual Studio .NET.
  2. On the File menu, point to New, and then click Project.
  3. Under Project Types, click Visual Basic Projects, or Visual C# Projects, and then under Templates, click Console Application.
  4. In the Name text box, type MyTestConsoleApplication, and in the Location text box, type C:\, and then click OK.
  5. Replace the existing code with the following code:

    Visual C# .NET Code

    using System;
    using System.Data;
    using System.Xml.Serialization;
    using System.IO;
    using System.Xml;
    using System.Xml.Schema;
    
    namespace MyTestConsoleApplication
    {
       class MyTestClass
       {
          [STAThread]
          static void Main(string[] args)
          {
             // Deserializing the data in XML Document to the object of type
             // of the class generated by xsd.exe for XML Schema
             Root myRootObj;
             FileStream fStream = new FileStream(@"C:\MyTestConsoleApplication\customers.xml", FileMode.Open);
             XmlSerializer mySerializer = new XmlSerializer(typeof(Root));
             myRootObj = (Root)mySerializer.Deserialize(fStream);
             mySerializer.Serialize(System.Console.OpenStandardOutput(), myRootObj);
             fStream.Close();
             Console.ReadLine();
          }
       }
    }

    Visual Basic .NET Code

    Imports System
    Imports System.Data
    Imports System.Xml.Serialization
    Imports System.IO
    Imports System.Xml
    Imports System.Xml.Schema
    
    Module Module1
    
       Sub Main()
          ' Deserializing the data in XML Document to the object of type
          ' of the class generated by xsd.exe for XML Schema
          Dim myRootObj As Root
          Dim fStream As New FileStream("C:\MyTestConsoleApplication\customers.xml", FileMode.Open)
          Dim mySerializer As New XmlSerializer(GetType(Root))
          myRootObj = mySerializer.Deserialize(fStream)
          mySerializer.Serialize(System.Console.OpenStandardOutput(), myRootObj)
          fStream.Close()
          Console.ReadLine()
       End Sub
    
    End Module
  6. On the File menu, point to New, and then click File.
  7. Under Categories, click General, and then under Templates, click XML Schema. Click Open.
  8. Click the XML tab. Replace the existing code with the following XML Schema code:

    <?xml version="1.0" ?>
    <xs:schema id="Root" targetNamespace="http://tempuri.org/customer.xsd" xmlns:mstns="http://tempuri.org/customer.xsd" xmlns="http://tempuri.org/customer.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" attributeFormDefault="qualified" elementFormDefault="qualified">
        <xs:element name="Root" msdata:IsDataSet="true" msdata:EnforceConstraints="False">
            <xs:complexType>
                <xs:choice maxOccurs="unbounded">
                    <xs:element name="Customers" minOccurs="0" maxOccurs="unbounded">
                        <xs:complexType>
                            <xs:sequence>
                                <xs:choice minOccurs="0">
                                    <xs:element name="workphone" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
                                    <xs:element name="homephone" type="xs:string" minOccurs="0" />
                                    <xs:element name="cellphone" type="xs:string" minOccurs="0" />
                                </xs:choice>
                                <xs:element name="CustName" type="xs:string" minOccurs="0" />
                                <xs:element name="CustID" type="xs:string" />
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                </xs:choice>
            </xs:complexType>
            <xs:key name="RootKey1">
                <xs:selector xpath=".//mstns:Customers" />
                <xs:field xpath="mstns:CustID" />
            </xs:key>
        </xs:element>
    </xs:schema>
  9. On the File menu, click Save XMLSchema1 As.
  10. Name the file C:\MyTestConsoleApplication\customers.xsd, and then click Save.
  11. On the File menu, point to New, and then click File.
  12. Under Categories, click General, and then under Templates, click XML File. Click Open.
  13. Click the XML tab. Replace the existing code with the following XML code:

    <?xml version="1.0" encoding="utf-8" ?>
    <Root xmlns="http://tempuri.org/customer.xsd">
       <Customers>
          <cellphone>9887858</cellphone>
          <cellphone>4645645</cellphone>
          <homephone>8743857</homephone>
          <homephone>2345678</homephone>
          <CustName>3saqib2</CustName>
          <CustID>32</CustID>
       </Customers>
       <Customers>
          <homephone>8763857</homephone>
          <cellphone>9876543</cellphone>
          <CustName>Mian</CustName>
          <CustID>2</CustID>
       </Customers>
    </Root>
  14. On the File menu, click Save XMLFile1 As.
  15. Name the file C:\MyTestConsoleApplication\customers.xml, and then click Save.
  16. Start Visual Studio .NET Command Prompt.
  17. To generate a class file for the schema, type the following command at command prompt, and then press ENTER:

    To Generate Visual C# .NET Class

    xsd /c /l:cs /out:C:\MyTestConsoleApplication C:\MyTestConsoleApplication\customer.xsd

    To Generate Visual Basic .NET Class

    xsd /c /l:vb /out:C:\MyTestConsoleApplication C:\MyTestConsoleApplication\customer.xsd
  18. In Solution Explorer, click the Show All Files icon.
  19. Make sure that customer.cs, or customer.vb, is available in the list of files.
  20. Right-click customer.cs, or customer.vb, and then click Include In Project.
  21. On the Debug menu, click Start. You may notice multiple entries for cellphone and homephone in the Output window.
  22. Press ENTER to close the console.
  23. In XMLSchema1.xsd, locate the following choice element:

                                <xs:choice minOccurs="0">
                                    <xs:element name="workphone" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
                                    <xs:element name="homephone" type="xs:string" minOccurs="0" />
                                    <xs:element name="cellphone" type="xs:string" minOccurs="0" />
                                </xs:choice>

    Replace the choice element with the following choice elements:

                             <xs:choice minOccurs="0">
                                  <xs:element name="workphone" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
                                </xs:choice>
                                <xs:choice minOccurs="0">
                                    <xs:element name="homephone" type="xs:string" minOccurs="0" />
                                    <xs:element name="cellphone" type="xs:string" minOccurs="0" />
                                </xs:choice>
  24. On the Debug menu, click Start.


REFERENCES

For additional information about XML Schema in the .NET Framework, click the following article number to view the article in the Microsoft Knowledge Base:

313826 INFO: Roadmap for XML Schemas in the .NET Framework


Keywords: kbbug kbschema kbxml kbserial kbcodegen kbvs2002sp1sweep KB816226