title: XSD class generation nested tables problem
body: <p>Currently I'm having a problem with generating class files from a xsd with repeating elements. I’m using the custom tool ‘MsDatasetGenerator’ in VS2005 SP1 witch create a typed dataset from the xsd for c#. I’m trying to parse the xml by this schema</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding=\"utf-8\"?&gt;
  &lt;xs:schema id="XSDobject" targetNamespace="http://tempuri.org/XSDobject.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/XSDobject.xsd" xmlns:mstns="http://tempuri.org/XSDobject.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
      &lt;xs:element name="order"&gt;
          &lt;xs:complexType&gt;
              &lt;xs:sequence&gt;
                  &lt;xs:element name="contact"&gt;
                      &lt;xs:complexType&gt;
                          &lt;xs:sequence&gt;
                              &lt;xs:element name="name" type="xs:string" /&gt;
                              &lt;xs:element name="phone" type="xs:string" /&gt;
                          &lt;/xs:sequence&gt;
                      &lt;/xs:complexType&gt;
                  &lt;/xs:element&gt;
                  &lt;xs:element name="buyer"&gt;
                      &lt;xs:complexType&gt;
                          &lt;xs:sequence&gt;
                              &lt;xs:element name="contact"&gt;
                                  &lt;xs:complexType&gt;
                                      &lt;xs:sequence&gt;
                                          &lt;xs:element name="name" type="xs:string" /&gt;
                                          &lt;xs:element name="phone" type="xs:string" /&gt;
                                      &lt;/xs:sequence&gt;
                                  &lt;/xs:complexType&gt;
                              &lt;/xs:element&gt;
                          &lt;/xs:sequence&gt;
                      &lt;/xs:complexType&gt;
                  &lt;/xs:element&gt;
              &lt;/xs:sequence&gt;
          &lt;/xs:complexType&gt;
      &lt;/xs:element&gt;
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>But I get following error “<strong>The same table 'contact' cannot be the child table in two nested relations.</strong>”</p>
  
  <p>The XSD compiles correctly but it’s the typed dataset that can’t handle repeating tables. Now I have tested also the xsd.exe tool but it seems to generate the same code as the msdatasetgenerator. I also tried some third party code generator tools like XSD2Code, CodeXS, AltovaXmlSpy but also I can’t get it to work with nested elements.</p>
  
  <p>Alternatively I could solve the problem with xslt transformation at the input and the output but it would cost me a lot of performance. </p>
  
  <p>So now I’m asking if someone could help me with a good solution for VS2005, or know good xsd class generator that can handle this problem. It doesn’t have to be a typed dataset if it works as an array or a list it is also perfect as long it is easy to serializing and deserializing it.</p>
  
  <p>Thanks in advance
  Freggel</p>