Tema: c# deserializacijos problema
Autorius: blah
Data: 2009-03-09 21:31:48
turiu xml, is jo pasidariau xml schema, po to pasidariau klase.
deserializuoju klase, bet objekte blogai buna "tbody" objektas t.y. jame 
niekada nebuna "tr" objektu, kur cia darau  klaida ?
failu sourcus parasiau zemiau, is anksto aciu :)

=============================================
                    xml:
=============================================
<?xml version="1.0" encoding="utf-8" ?>
<TSResponse>
  <table>
    <tr>
      <td></td>
      <td><h2>test</h2></td>
      <td><a><span>test</span></a></td>
    </tr>
  </table>
  <table>
    <tbody>
      <tr>
        <td><p>test</p></td>
        <td>1</td>
        <td>1</td>
        <td>1</td>
        <td>1</td>
        <td>1</td>
        <td>1</td>
        <td></td>
      </tr>
      <tr>
        <td>1</td>
        <td><p>test</p></td>
        <td><a>1</a></td>
        <td><a>1</a></td>
        <td><a>1</a></td>
        <td>1</td>
        <td>1</td>
        <td>1</td>
        <td></td>
      </tr>
      <tr>
        <td><p>test</p></td>
        <td>1</td>
        <td>1</td>
        <td>1</td>
        <td>1</td>
        <td>1</td>
        <td>1</td>
        <td></td>
      </tr>
      <tr>
        <td>1</td>
        <td><p>test</p></td>
        <td><a>1</a></td>
        <td><a>1</a></td>
        <td><a>1</a></td>
        <td><a>1</a></td>
        <td><a>1</a></td>
        <td>1</td>
        <td><a>1</a></td>
      </tr>
    </tbody>
  </table>
</TSResponse>
=============================================
            xml schema (xsd):
=============================================
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
elementFormDefault="qualified">
  <xs:element name="data">
    <xs:complexType>
      <xs:choice maxOccurs="unbounded">
        <xs:element ref="a"/>
        <xs:element ref="table"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <xs:element name="table">
    <xs:complexType>
      <xs:choice>
        <xs:element ref="tr"/>
        <xs:element ref="tbody"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <xs:element name="tbody">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="tr"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="a">
    <xs:complexType mixed="true">
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="span"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="span" type="xs:NCName"/>
  <xs:element name="tr">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="td"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="td">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="a"/>
        <xs:element ref="h2"/>
        <xs:element ref="p"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <xs:element name="h2" type="xs:string"/>
  <xs:element name="p" type="xs:string"/>
</xs:schema>
=============================================
                  klase:
=============================================
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", 
"2.0.50727.1432")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = 
false)]
    public partial class TSResponse
    {
        private table[] tableField;
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("table")]
        public table[] table
        {
            get{return this.tableField;}
            set{this.tableField = value;}
        }
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", 
"2.0.50727.1432")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = 
false)]
    public partial class table
    {
        private object itemField;
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("tbody", 
typeof(tbody))]
        [System.Xml.Serialization.XmlElementAttribute("tr", typeof(tr))]
        public object Item
        {
            get{return this.itemField;}
            set{this.itemField = value;}
        }
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", 
"2.0.50727.1432")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = 
false)]
    public partial class tbody
    {
        private tr[] trField;
        /// <remarks/>
        [System.Xml.Serialization.XmlArrayItemAttribute("tr", typeof(tr), 
IsNullable = false)]
        public tr[] tr
        {
            get{return this.trField;}
            set{this.trField = value;}
        }
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", 
"2.0.50727.1432")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = 
false)]
    public partial class tr
    {
        private td[] tdField;
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("td")]
        public td[] td
        {
            get{return this.tdField;}
            set{this.tdField = value;}
        }
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", 
"2.0.50727.1432")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = 
false)]
    public partial class td
    {
        private object[] itemsField;
        private ItemsChoiceType[] itemsElementNameField;
        private string[] textField;
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("a", typeof(a))]
        [System.Xml.Serialization.XmlElementAttribute("h2", typeof(string))]
        [System.Xml.Serialization.XmlElementAttribute("p", typeof(string))]
        [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemsElementName")]
        public object[] Items
        {
            get{return this.itemsField;}
            set{this.itemsField = value;}
        }
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("ItemsElementName")]
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        public ItemsChoiceType[] ItemsElementName
        {
            get{return this.itemsElementNameField;}
            set{this.itemsElementNameField = value;}
        }
        /// <remarks/>
        [System.Xml.Serialization.XmlTextAttribute()]
        public string[] Text
        {
            get{return this.textField;}
            set{this.textField = value;}
        }
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", 
"2.0.50727.1432")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = 
false)]
    public partial class a
    {
        private string[] spanField;
        private string[] textField;
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute("span", DataType = 
"NCName")]
        public string[] span
        {
            get{return this.spanField;}
            set{this.spanField = value;}
        }
        /// <remarks/>
        [System.Xml.Serialization.XmlTextAttribute()]
        public string[] Text
        {
            get{return this.textField;}
            set{this.textField = value;}
        }
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", 
"2.0.50727.1432")]
    [System.SerializableAttribute()]
    [System.Xml.Serialization.XmlTypeAttribute(IncludeInSchema = false)]
    public enum ItemsChoiceType
    {
        /// <remarks/>
        a,
        /// <remarks/>
        h2,
        /// <remarks/>
        p,
    } 


3Dastronomyagricultureaudioautosautos.audiautos.audioautos.binariesautos.bmwautos.clubautos.fordautos.hondacrxautos.japanautos.mercedesautos.opelautos.sportautos.volvoautos.vwaviaavia.binariesbankcardsbinariesbooksbuildingcinemacommercecomp.hardwarecomp.softwarecomp.lietuvinimascomp.networksculturedarbas.ieskaudarbas.siulaudesigneconomicselectronicsfaunafauna.aquafauna.binariesfishingflorafotofoto.binariesgamesgames.csgames.onlinegsmgurmanaihumourhumour.binariesinternetlawmicrosoftmotomusicmusic.binariesmusic.instrumentsmusic.LT.binariesnavigacijaphppoliticsprogrammingrpgsportstudyingsveikatatalktesttranslationtransportationtraveltravel.binariestvunixvideovideo.binarieswatersportswwwwww.flashpdaautos.supermama.ltmobiledarbasretro.3Dretro.agricultureretro.astronomyretro.audioretro.autosretro.autos.audiretro.autos.audioretro.autos.binariesretro.autos.bmwretro.autos.clubretro.autos.fordretro.autos.hondacrxretro.autos.japanretro.autos.mercedesretro.autos.opelretro.autos.sportretro.autos.supermamaretro.autos.supermama.ltretro.autos.volvoretro.autos.vwretro.aviaretro.avia.binariesretro.bankcardsretro.beosretro.binariesretro.booksretro.buildingretro.cinemaretro.commerceretro.compretro.comp.hardwareretro.comp.lietuvinimasretro.comp.networksretro.comp.softwareretro.cultureretro.darbasretro.darbas.ieskauretro.darbas.siulauretro.designretro.economicsretro.electronicsretro.e-vejasretro.faunaretro.fauna.aquaretro.fauna.binariesretro.fishingretro.floraretro.fotoretro.foto.binariesretro.gamesretro.games.csretro.games.onlineretro.games.rpgretro.genealogijaretro.gsmretro.gurmanairetro.humourretro.humour.binariesretro.internetretro.YZFretro.YZF.nebukretro.YZF.nebuk.netikintisretro.YZF.nebuk.netikintis.bukretro.YZF.nebuk.netikintis.buk.tikintisretro.lawretro.microsoftretro.mobileretro.motoretro.musicretro.music.binariesretro.music.instrumentsretro.music.LTretro.music.LT.binariesretro.navigacijaretro.newsretro.news.taisyklesretro.newuserretro.pdaretro.phpretro.politicsretro.programmingretro.rpgretro.sportretro.studyingretro.sveikataretro.talkretro.translationretro.transportationretro.travelretro.travel.binariesretro.tvretro.unixretro.videoretro.video.binariesretro.watersportsretro.wwwretro.www.flashdiylt.rkm.news.announcelt.rkm.news.newuser