Respected Experts,
I created a Class of an XSD file by
XSD /d /l:cd StockItem.XSD /n:kings.erp which is attached here
<?xml version="1.0" standalone="yes"?><xs:schema id="ENVELOPE" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"><xs:element name="LANGUAGENAME.LIST"><xs:complexType><xs:sequence><xs:element name="LANGUAGEID" type="xs:string" minOccurs="0" /><xs:element name="NAME.LIST" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="NAME" type="xs:string" minOccurs="0" msdata:Ordinal="0" /></xs:sequence><xs:attribute name="TYPE" type="xs:string" /></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element><xs:element name="ENVELOPE" msdata:IsDataSet="true" msdata:UseCurrentLocale="true"><xs:complexType><xs:choice minOccurs="0" maxOccurs="unbounded"><xs:element ref="LANGUAGENAME.LIST" /><xs:element name="HEADER"><xs:complexType><xs:sequence><xs:element name="TALLYREQUEST" type="xs:string" minOccurs="0" /></xs:sequence></xs:complexType></xs:element><xs:element name="BODY"><xs:complexType><xs:sequence><xs:element name="IMPORTDATA" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="REQUESTDESC" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="REPORTNAME" type="xs:string" minOccurs="0" /><xs:element name="STATICVARIABLES" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="SVCURRENTCOMPANY" type="xs:string" minOccurs="0" /></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element><xs:element name="REQUESTDATA" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="TALLYMESSAGE" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="STOCKITEM" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="PARENT" type="xs:string" minOccurs="0" msdata:Ordinal="0" /><xs:element name="CATEGORY" type="xs:string" minOccurs="0" msdata:Ordinal="1" /><xs:element name="TAXCLASSIFICATIONNAME" type="xs:string" minOccurs="0" msdata:Ordinal="2" /><xs:element name="COSTINGMETHOD" type="xs:string" minOccurs="0" msdata:Ordinal="3" default="Avg. Cost" /><xs:element name="VALUATIONMETHOD" type="xs:string" minOccurs="0" msdata:Ordinal="4" default="Avg. Price" /><xs:element name="BASEUNITS" type="xs:string" minOccurs="0" msdata:Ordinal="5" /><xs:element name="ADDITIONALUNITS" type="xs:string" minOccurs="0" msdata:Ordinal="6" /><xs:element name="EXCISEITEMCLASSIFICATION" type="xs:string" minOccurs="0" msdata:Ordinal="7" default="Default" /><xs:element name="ISCOSTCENTRESON" type="xs:string" minOccurs="0" msdata:Ordinal="8" default="No"/><xs:element name="ISBATCHWISEON" type="xs:string" minOccurs="0" msdata:Ordinal="9" default="No" /><xs:element name="ISPERISHABLEON" type="xs:string" minOccurs="0" msdata:Ordinal="10" default="No"/><xs:element name="ISENTRYTAXAPPLICABLE" type="xs:string" minOccurs="0" msdata:Ordinal="11" default="No"/><xs:element name="IGNOREPHYSICALDIFFERENCE" type="xs:string" minOccurs="0" msdata:Ordinal="12" default="No"/><xs:element name="IGNORENEGATIVESTOCK" type="xs:string" minOccurs="0" msdata:Ordinal="13" default="Yes" /><xs:element name="TREATSALESASMANUFACTURED" type="xs:string" minOccurs="0" msdata:Ordinal="14" default="No"/><xs:element name="TREATPURCHASESASCONSUMED" type="xs:string" minOccurs="0" msdata:Ordinal="15" default="No"/><xs:element name="TREATREJECTSASSCRAP" type="xs:string" minOccurs="0" msdata:Ordinal="16" default="No"/><xs:element name="HASMFGDATE" type="xs:string" minOccurs="0" msdata:Ordinal="17" default="No"/><xs:element name="ALLOWUSEOFEXPIREDITEMS" type="xs:string" minOccurs="0" msdata:Ordinal="18" default="No" /><xs:element name="IGNOREBATCHES" type="xs:string" minOccurs="0" msdata:Ordinal="19" default="No"/><xs:element name="IGNOREGODOWNS" type="xs:string" minOccurs="0" msdata:Ordinal="20" default="Yes"/><xs:element name="EXCLUDEJRNLFORVALUATION" type="xs:string" minOccurs="0" msdata:Ordinal="21" default="No"/><xs:element name="ISMRPINCLOFTAX" type="xs:string" minOccurs="0" msdata:Ordinal="22" default="No"/><xs:element name="ISADDLTAXEXEMPT" type="xs:string" minOccurs="0" msdata:Ordinal="23" default="No"/><xs:element name="ISSUPPLEMENTRYDUTYON" type="xs:string" minOccurs="0" msdata:Ordinal="24" default="No"/><xs:element name="REORDERASHIGHER" type="xs:string" minOccurs="0" msdata:Ordinal="25" default="No"/><xs:element name="MINORDERASHIGHER" type="xs:string" minOccurs="0" msdata:Ordinal="26" default="No"/><xs:element name="DENOMINATOR" type="xs:string" minOccurs="0" msdata:Ordinal="27" default="1"/><xs:element name="RATEOFVAT" type="xs:string" minOccurs="0" msdata:Ordinal="28" /><xs:element ref="LANGUAGENAME.LIST" minOccurs="0" maxOccurs="unbounded" /></xs:sequence><xs:attribute name="NAME" type="xs:string" /><xs:attribute name="RESERVEDNAME" type="xs:string" /></xs:complexType></xs:element><xs:element name="STOCKGROUP" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="PARENT" type="xs:string" minOccurs="0" msdata:Ordinal="0" /><xs:element name="COSTINGMETHOD" type="xs:string" minOccurs="0" msdata:Ordinal="1" default="Avg. Cost"/><xs:element name="VALUATIONMETHOD" type="xs:string" minOccurs="0" msdata:Ordinal="2" default="Avg. Price"/><xs:element name="BASEUNITS" type="xs:string" minOccurs="0" msdata:Ordinal="3" /><xs:element name="ADDITIONALUNITS" type="xs:string" minOccurs="0" msdata:Ordinal="4" /><xs:element name="ISBATCHWISEON" type="xs:string" minOccurs="0" msdata:Ordinal="5" default="No"/><xs:element name="ISPERISHABLEON" type="xs:string" minOccurs="0" msdata:Ordinal="6" default="No"/><xs:element name="ISADDABLE" type="xs:string" minOccurs="0" msdata:Ordinal="7" default="No"/><xs:element name="IGNOREPHYSICALDIFFERENCE" type="xs:string" minOccurs="0" msdata:Ordinal="8" default="No"/><xs:element name="IGNORENEGATIVESTOCK" type="xs:string" minOccurs="0" msdata:Ordinal="9" default="No"/><xs:element name="TREATSALESASMANUFACTURED" type="xs:string" minOccurs="0" msdata:Ordinal="10" default="No"/><xs:element name="TREATPURCHASESASCONSUMED" type="xs:string" minOccurs="0" msdata:Ordinal="11" default="No"/><xs:element name="TREATREJECTSASSCRAP" type="xs:string" minOccurs="0" msdata:Ordinal="12" default="No"/><xs:element name="HASMFGDATE" type="xs:string" minOccurs="0" msdata:Ordinal="13" default="No"/><xs:element name="ALLOWUSEOFEXPIREDITEMS" type="xs:string" minOccurs="0" msdata:Ordinal="14" default="No"/><xs:element name="IGNOREBATCHES" type="xs:string" minOccurs="0" msdata:Ordinal="15" default="No"/><xs:element name="IGNOREGODOWNS" type="xs:string" minOccurs="0" msdata:Ordinal="16" default="No"/><xs:element name="DENOMINATOR" type="xs:string" minOccurs="0" msdata:Ordinal="17" default="1"/><xs:element ref="LANGUAGENAME.LIST" minOccurs="0" maxOccurs="unbounded" /></xs:sequence><xs:attribute name="NAME" type="xs:string" /><xs:attribute name="RESERVEDNAME" type="xs:string" /></xs:complexType></xs:element><xs:element name="GODOWN" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="EXCISEREGISTRATIONDATE" type="xs:string" minOccurs="0" msdata:Ordinal="1" /><xs:element name="PINCODE" type="xs:string" minOccurs="0" msdata:Ordinal="2" /><xs:element name="PHONENUMBER" type="xs:string" minOccurs="0" msdata:Ordinal="3" /><xs:element name="EXCISERANGE" type="xs:string" minOccurs="0" msdata:Ordinal="4" /><xs:element name="EXCISERANGEADDRESS" type="xs:string" minOccurs="0" msdata:Ordinal="5" /><xs:element name="EXCISEDIVISIONADDRESS" type="xs:string" minOccurs="0" msdata:Ordinal="6" /><xs:element name="EXCISECOMMISSIONERATE" type="xs:string" minOccurs="0" msdata:Ordinal="7" /><xs:element name="EXCISERANGECODE" type="xs:string" minOccurs="0" msdata:Ordinal="8" /><xs:element name="EXCISEDIVISIONCODE" type="xs:string" minOccurs="0" msdata:Ordinal="9" /><xs:element name="PARENT" type="xs:string" minOccurs="0" msdata:Ordinal="10" /><xs:element name="EXCISEREGNO" type="xs:string" minOccurs="0" msdata:Ordinal="11" /><xs:element name="JOBNAME" type="xs:string" minOccurs="0" msdata:Ordinal="12" /><xs:element name="EXCISEREGISTRATIONTYPE" type="xs:string" minOccurs="0" msdata:Ordinal="13" /><xs:element name="EXCISEMAILINGNAME" type="xs:string" minOccurs="0" msdata:Ordinal="14" /><xs:element name="EXCISEMANUFACTURERTYPE" type="xs:string" minOccurs="0" msdata:Ordinal="15" /><xs:element name="EXCISELARGETAXPAYER" type="xs:string" minOccurs="0" msdata:Ordinal="16" /><xs:element name="EXCISEDIVISIONNAME" type="xs:string" minOccurs="0" msdata:Ordinal="17" /><xs:element name="EXCISECOMSNRATECODE" type="xs:string" minOccurs="0" msdata:Ordinal="18" /><xs:element name="EXCISECOMSNRATEADDRESS" type="xs:string" minOccurs="0" msdata:Ordinal="19" /><xs:element name="HASNOSPACE" type="xs:string" minOccurs="0" msdata:Ordinal="20" /><xs:element name="HASNOSTOCK" type="xs:string" minOccurs="0" msdata:Ordinal="21" /><xs:element name="ADDRESS.LIST" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="ADDRESS" nillable="true" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:simpleContent msdata:ColumnName="ADDRESS_Text" msdata:Ordinal="0"><xs:extension base="xs:string"></xs:extension></xs:simpleContent></xs:complexType></xs:element></xs:sequence><xs:attribute name="TYPE" type="xs:string" /></xs:complexType></xs:element><xs:element ref="LANGUAGENAME.LIST" minOccurs="0" maxOccurs="unbounded" /><xs:element name="SERIALNUMBERLIST.LIST" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="EXCISEBOOKNAME" type="xs:string" minOccurs="0" /></xs:sequence></xs:complexType></xs:element></xs:sequence><xs:attribute name="NAME" type="xs:string" /><xs:attribute name="RESERVEDNAME" type="xs:string" /></xs:complexType></xs:element><xs:element name="TARIFFCLASSIFICATION" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="HSN" type="xs:string" minOccurs="0" msdata:Ordinal="0" /><xs:element name="USEDFOR" type="xs:string" minOccurs="0" msdata:Ordinal="1" /><xs:element name="SORTPOSITION" type="xs:string" minOccurs="0" msdata:Ordinal="2" /><xs:element ref="LANGUAGENAME.LIST" minOccurs="0" maxOccurs="unbounded" /></xs:sequence><xs:attribute name="NAME" type="xs:string" /><xs:attribute name="RESERVEDNAME" type="xs:string" /></xs:complexType></xs:element><xs:element name="SERIALNUMBER" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="NUMBERINGMETHOD" type="xs:string" minOccurs="0" msdata:Ordinal="0" /><xs:element name="PREVENTDUPLICATES" type="xs:string" minOccurs="0" msdata:Ordinal="1" /><xs:element name="PREFILLZERO" type="xs:string" minOccurs="0" msdata:Ordinal="2" /><xs:element name="BEGINNINGNUMBER" type="xs:string" minOccurs="0" msdata:Ordinal="3" /><xs:element ref="LANGUAGENAME.LIST" minOccurs="0" maxOccurs="unbounded" /><xs:element name="RESTARTFROMLIST.LIST" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="DATE" type="xs:string" minOccurs="0" /><xs:element name="RESTARTFROM" type="xs:string" minOccurs="0" /><xs:element name="PERIODBEGINNIGNUM" type="xs:string" minOccurs="0" /><xs:element name="LASTNUMBERLIST.LIST" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="DATE" type="xs:string" minOccurs="0" /><xs:element name="LASTNUMBER" type="xs:string" minOccurs="0" /></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element></xs:sequence><xs:attribute name="NAME" type="xs:string" /><xs:attribute name="RESERVEDNAME" type="xs:string" /></xs:complexType></xs:element><xs:element name="CURRENCY" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="ORIGINALNAME" type="xs:string" minOccurs="0" msdata:Ordinal="0" /><xs:element name="MAILINGNAME" type="xs:string" minOccurs="0" msdata:Ordinal="1" /><xs:element name="EXPANDEDSYMBOL" type="xs:string" minOccurs="0" msdata:Ordinal="2" /><xs:element name="DECIMALSYMBOL" type="xs:string" minOccurs="0" msdata:Ordinal="3" /><xs:element name="ISSUFFIX" type="xs:string" minOccurs="0" msdata:Ordinal="4" /><xs:element name="HASSPACE" type="xs:string" minOccurs="0" msdata:Ordinal="5" /><xs:element name="INMILLIONS" type="xs:string" minOccurs="0" msdata:Ordinal="6" /><xs:element name="DECIMALPLACES" type="xs:string" minOccurs="0" msdata:Ordinal="7" /><xs:element name="DECIMALPLACESFORPRINTING" type="xs:string" minOccurs="0" msdata:Ordinal="8" /></xs:sequence><xs:attribute name="NAME" type="xs:string" /><xs:attribute name="RESERVEDNAME" type="xs:string" /></xs:complexType></xs:element><xs:element name="UNIT" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="ISSIMPLEUNIT" type="xs:string" minOccurs="0" msdata:Ordinal="0" /><xs:element name="DECIMALPLACES" type="xs:string" minOccurs="0" msdata:Ordinal="1" /><xs:element name="NAME" type="xs:string" minOccurs="0" msdata:Ordinal="2" /><xs:element name="RESERVEDNAME" type="xs:string" minOccurs="0" msdata:Ordinal="3" /></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element></xs:choice></xs:complexType></xs:element></xs:schema>
on using the generated class
XmlSerializer s = new XmlSerializer(typeof(ENVELOPE)); System.IO.TextWriter w = new System.IO.StreamWriter(@"C:\temp\stocktest.xml"); s.Serialize(w, new ENVELOPE()); w.Close();
I m getting error
The same table 'LANGUAGENAME.LIST' cannot be the child table in two nested relations.
how can i solve it