Cannnot load from XML to class

Dec 11, 2013 at 12:12 AM
Hello all. Can someone help me on this please.

I've been given an XSD, from a 3rd party, and that cannot be changed. A valid XML is also provided. But no matter how much I try, I cannot make a class running. I tried all the options of XSD2CODE, and it's failing.
Here is my complete XSD.
``` <?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wmh="http://www.wmhelp.com/2003/eGenerator" elementFormDefault="qualified">
<xs:element name="Tender">
<xs:complexType>
  <xs:sequence>
    <xs:element ref="StatusTender"/>
    <xs:element ref="GoodOrServices"/>
    <xs:element ref="Notification"/>
    <xs:element ref="ContractNoticeNr"/>
    <xs:element ref="DocReference"/>
    <xs:element ref="OtherPublications"/>
    <xs:element ref="DocumentSentContract"/>
    <xs:element ref="NotificationLinkContract"/>
    <xs:element ref="CountryAbbreviation"/>
    <xs:element ref="ContractAuthority"/>
    <xs:element ref="Place"/>
    <xs:element ref="NameAddressContactPoints"/>
    <xs:element ref="TitleTender"/>
    <xs:element ref="ShortDescriptionTender"/>
    <xs:element ref="TypeOfContract"/>
    <xs:element ref="Operators"/>
    <xs:element ref="EnvisagedNumberOperators"/>
    <xs:element ref="FrameworkPeriodYears"/>
    <xs:element ref="TotalBudgetFramework"/>
    <xs:element ref="CPV"/>
    <xs:element ref="GovernmentProcurementAgreement"/>
    <xs:element ref="DivisionInToLots"/>
    <xs:element ref="AlternativeOfferAllowed"/>
    <xs:element ref="TenderProcedure"/>
    <xs:element ref="TypeOfProcedure"/>
    <xs:element ref="FileReference"/>
    <xs:element ref="Scope"/>
    <xs:element ref="BudgetContractPeriod"/>
    <xs:element ref="ContractPeriod"/>
    <xs:element ref="AwardCriteria"/>
    <xs:element ref="ElectronicAuction"/>
    <xs:element ref="PublicationDateContract"/>
    <xs:element ref="ClosingDate"/>
    <xs:element ref="NumberOfDaysBeforeClosingDate"/>
    <xs:element ref="DeadlineForQuestions"/>
    <xs:element ref="BidBond"/>
    <xs:element ref="PerformanceBond"/>
    <xs:element ref="TypeOfPublication"/>
    <xs:element ref="AdditionalInfoRawText"/>
    <xs:element ref="Lots"/>
    <xs:element ref="Contracts"/>
  </xs:sequence>
  <xs:attribute name="docnum" type="xs:string"/>
  <xs:attribute name="doctype" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:element name="StatusTender">
<xs:complexType/>
</xs:element>
<xs:element name="GoodOrServices" type="xs:string"/>
<xs:element name="Notification" type="xs:string"/>
<xs:element name="ContractNoticeNr" type="xs:string"/>
<xs:element name="DocReference" type="xs:string"/>
<xs:element name="OtherPublications" type="xs:string"/>
<xs:element name="DocumentSentContract" type="xs:string"/>
<xs:element name="NotificationLinkContract" type="xs:string"/>
<xs:element name="CountryAbbreviation" type="xs:string"/>
<xs:element name="ContractAuthority" type="xs:string"/>
<xs:element name="Place" type="xs:string"/>
<xs:element name="NameAddressContactPoints">
<xs:complexType>
  <xs:sequence>
    <xs:element ref="NameAddressContactPoint" maxOccurs="unbounded"/>
  </xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="NameAddressContactPoint">
<xs:complexType>
  <xs:simpleContent>
    <xs:extension base="xs:string">
      <xs:attribute name="key" type="xs:string"/>
      <xs:attribute name="name" type="xs:string"/>
      <xs:attribute name="attention" type="xs:string"/>
      <xs:attribute name="address" type="xs:string"/>
      <xs:attribute name="postalcode" type="xs:string"/>
      <xs:attribute name="city" type="xs:string"/>
      <xs:attribute name="countrycode" type="xs:string"/>
      <xs:attribute name="phonenumber" type="xs:string"/>
      <xs:attribute name="email" type="xs:string"/>
      <xs:attribute name="fax" type="xs:string"/>
    </xs:extension>
  </xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="TitleTender" type="xs:string"/>
<xs:element name="ShortDescriptionTender" type="xs:string"/>
<xs:element name="TypeOfContract" type="xs:string"/>
<xs:element name="Operators" type="xs:string"/>
<xs:element name="EnvisagedNumberOperators" type="xs:string"/>
<xs:element name="FrameworkPeriodYears" type="xs:string"/>
<xs:element name="TotalBudgetFramework">
<xs:complexType>
  <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element ref="EconomicValueSingle" />
    <xs:element ref="EconomicValueRange" />
  </xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="EconomicValueSingle">
<xs:complexType>
  <xs:attribute name="key" type="xs:string"/>
  <xs:attribute name="value" type="xs:string"/>
  <xs:attribute name="currency" type="xs:string"/>
  <xs:attribute name="vat" type="xs:string"/>
  <xs:attribute name="eurovalue" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:element name="EconomicValueRange">
<xs:complexType>
  <xs:attribute name="key" type="xs:string"/>
  <xs:attribute name="minvalue" type="xs:string"/>
  <xs:attribute name="maxvalue" type="xs:string"/>
  <xs:attribute name="currency" type="xs:string"/>
  <xs:attribute name="vat" type="xs:string"/>
  <xs:attribute name="eurovalue" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:element name="CPV" type="xs:string"/>
<xs:element name="GovernmentProcurementAgreement" type="xs:string"/>
<xs:element name="DivisionInToLots" type="xs:string"/>
<xs:element name="AlternativeOfferAllowed" type="xs:string"/>
<xs:element name="TenderProcedure" type="xs:string"/>
<xs:element name="TypeOfProcedure" type="xs:string"/>
<xs:element name="FileReference" type="xs:string"/>
<xs:element name="Scope" type="xs:string"/>
<xs:element name="BudgetContractPeriod">
<xs:complexType>
  <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element ref="EconomicValueSingle" />
    <xs:element ref="EconomicValueRange" />
  </xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="ContractPeriod" type="xs:string"/>
<xs:element name="AwardCriteria" type="xs:string"/>
<xs:element name="ElectronicAuction" type="xs:string"/>
<xs:element name="PublicationDateContract" type="xs:string"/>
<xs:element name="ClosingDate" type="xs:string"/>
<xs:element name="NumberOfDaysBeforeClosingDate">
<xs:complexType/>
</xs:element>
<xs:element name="DeadlineForQuestions">
<xs:complexType/>
</xs:element>
<xs:element name="BidBond">
<xs:complexType/>
</xs:element>
<xs:element name="PerformanceBond">
<xs:complexType/>
</xs:element>
<xs:element name="TypeOfPublication">
<xs:complexType/>
</xs:element>
<xs:element name="AdditionalInfoRawText" type="xs:string"/>
<xs:element name="Lots">
<xs:complexType>
  <xs:sequence minOccurs="0" maxOccurs="unbounded">
    <xs:element ref="Lot" />
  </xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Lot">
<xs:complexType>
  <xs:sequence>
    <xs:element ref="LotNumberName"/>
    <xs:element ref="LotDescription"/>
    <xs:element ref="LotCPV"/>
    <xs:element ref="LotScope"/>
    <xs:element ref="LotNumberSurgiries"/>
    <xs:element ref="LotBudget"/>
    <xs:element ref="LotStartingDate"/>
    <xs:element ref="LotAdditionalInfo"/>
    <xs:element ref="LotProductGroup"/>
    <xs:element ref="LotEPC2"/>
    <xs:element ref="LotEPC3"/>
    <xs:element ref="LotEPC4"/>
    <xs:element ref="LotEPC5"/>
    <xs:element ref="LotEPC6"/>
    <xs:element ref="LotEPC7"/>
  </xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="LotNumberName">
<xs:complexType>
  <xs:simpleContent>
    <xs:extension base="xs:string">
      <xs:attribute name="lotpos" type="xs:string"/>
      <xs:attribute name="lotref" type="xs:string"/>
      <xs:attribute name="lottitle" type="xs:string"/>
    </xs:extension>
  </xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="LotDescription" type="xs:string"/>
<xs:element name="LotCPV" type="xs:string"/>
<xs:element name="LotScope" type="xs:string"/>
<xs:element name="LotNumberSurgiries">
<xs:complexType/>
</xs:element>
<xs:element name="LotBudget">
<xs:complexType>
  <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:element ref="EconomicValueSingle" />
    <xs:element ref="EconomicValueRange" />
  </xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="LotStartingDate" type="xs:string"/>
<xs:element name="LotAdditionalInfo" type="xs:string"/>
<xs:element name="LotProductGroup">
<xs:complexType/>
</xs:element>
<xs:element name="LotEPC2">
<xs:complexType/>
</xs:element>
<xs:element name="LotEPC3">
<xs:complexType/>
</xs:element>
<xs:element name="LotEPC4">
<xs:complexType/>
</xs:element>
<xs:element name="LotEPC5">
<xs:complexType/>
</xs:element>
<xs:element name="LotEPC6">
<xs:complexType/>
</xs:element>
<xs:element name="LotEPC7">
<xs:complexType/>
</xs:element>
<xs:element name="Contracts">
<xs:complexType>
  <xs:sequence minOccurs="0" maxOccurs="unbounded">
    <xs:element ref="Contract" />
  </xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Contract">
<xs:complexType>
  <xs:sequence>
    <xs:element ref="ContractNumber"/>
    <xs:element ref="DateAwardContract"/>
    <xs:element ref="NumberOffersReceived"/>
    <xs:element ref="ContractBidder"/>
    <xs:element ref="AwardValue"/>
  </xs:sequence>
</xs:complexType>
</xsd>
Coordinator
Jan 1, 2014 at 9:25 PM
Edited Jan 1, 2014 at 9:38 PM
Hello,
Your xsd seem to be invalid, the 'ContractNumber' element is not declared.
Pascal.