schema error

Hi All

When I try to load the below schema I get the error as

Failed to load schema.

Reason :
The 'http://www.w3.org/2001/XMLSchema:complexType' element is not supported in this context.

Can you please advice why I get this errors.

<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.www.com/PartyModel.xsd" elementFormDefault="qualified">
  <xs:element name="MasterParty">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="MasterPartyId" type="xs:integer" />
        <xs:element name="PartyTypeCode" type="xs:code" />
        <xs:element name="PartyStatusCode" type="xs:code"></xs:element>       
 <xs:element name="PartyCrossReference">
          <xs:complexType>
            <xs:complexType>
              <xs:sequence>
                <xs:element name="MasterPartyId" type="xs:int"></xs:element>
                <xs:element name="SourceIdentifier" type="xs:string" />
                <xs:element name="SourceSystemCode" type="xs:code" />
                <xs:element name="StartDate" type="xs:date"></xs:element>
                <xs:element name="EndDate" type="xs:date"></xs:element>
                <xs:element name="ConfirmationIndicator" type="xs:indicator"></xs:element>
              </xs:sequence>
            </xs:complexType>
          </xs:complexType>
        </xs:element>
     </xs:sequence>
   </xs:complexType>
</xs:element>
</xs:schema>

regards

suresh

January 31st, 2015 1:58pm

Hi,

The element with name 'PartyCrossReference' contains two <xs:complexType> declarations, you should remove one of those, the result should be:

<xs:element name="PartyCrossReference">
             <xs:complexType>
               <xs:sequence>
                 <xs:element name="MasterPartyId" type="xs:int"></xs:element>
                 <xs:element name="SourceIdentifier" type="xs:string" />
                 <xs:element name="SourceSystemCode" type="xs:code" />
                 <xs:element name="StartDate" type="xs:date"></xs:element>
                 <xs:element name="EndDate" type="xs:date"></xs:element>
                 <xs:element name="ConfirmationIndicator" type="xs:indicator"></xs:element>
               </xs:sequence>
           </xs:complexType>
         </xs:element>

Regards,

Ren

  • Marked as answer by s u r e s h 4 hours 56 minutes ago
Free Windows Admin Tool Kit Click here and download it now
January 31st, 2015 2:24pm

<xs:complexType> is not allowed under <xs:complexType>

Download XMLSPY, to validate your schema structure.

Try this.

<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.www.com/PartyModel.xsd" elementFormDefault="qualified">
  <xs:element name="MasterParty">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="MasterPartyId" type="xs:integer" />
        <xs:element name="PartyTypeCode" type="xs:code" />
        <xs:element name="PartyStatusCode" type="xs:code"></xs:element>        
 <xs:element name="PartyCrossReference">
          <xs:complexType>
            <xs:sequence>
                <xs:element name="MasterPartyId" type="xs:int"></xs:element>
                <xs:element name="SourceIdentifier" type="xs:string" />
                <xs:element name="SourceSystemCode" type="xs:code" />
                <xs:element name="StartDate" type="xs:date"></xs:element>
                <xs:element name="EndDate" type="xs:date"></xs:element>
                <xs:element name="ConfirmationIndicator" type="xs:indicator"></xs:element>
             </xs:sequence>
           </xs:complexType>
 </xs:element>
     </xs:sequence>
   </xs:complexType>
</xs:element>
</xs:schema>
January 31st, 2015 2:45pm

Thanks Rene
Free Windows Admin Tool Kit Click here and download it now
January 31st, 2015 10:01pm

Hi,

The element with name 'PartyCrossReference' contains two <xs:complexType> declarations, you should remove one of those, the result should be:

<xs:element name="PartyCrossReference">
             <xs:complexType>
               <xs:sequence>
                 <xs:element name="MasterPartyId" type="xs:int"></xs:element>
                 <xs:element name="SourceIdentifier" type="xs:string" />
                 <xs:element name="SourceSystemCode" type="xs:code" />
                 <xs:element name="StartDate" type="xs:date"></xs:element>
                 <xs:element name="EndDate" type="xs:date"></xs:element>
                 <xs:element name="ConfirmationIndicator" type="xs:indicator"></xs:element>
               </xs:sequence>
           </xs:complexType>
         </xs:element>

Regards,

Ren

  • Marked as answer by s u r e s h Sunday, February 01, 2015 2:58 AM
January 31st, 2015 10:22pm

Hi,

The element with name 'PartyCrossReference' contains two <xs:complexType> declarations, you should remove one of those, the result should be:

<xs:element name="PartyCrossReference">
             <xs:complexType>
               <xs:sequence>
                 <xs:element name="MasterPartyId" type="xs:int"></xs:element>
                 <xs:element name="SourceIdentifier" type="xs:string" />
                 <xs:element name="SourceSystemCode" type="xs:code" />
                 <xs:element name="StartDate" type="xs:date"></xs:element>
                 <xs:element name="EndDate" type="xs:date"></xs:element>
                 <xs:element name="ConfirmationIndicator" type="xs:indicator"></xs:element>
               </xs:sequence>
           </xs:complexType>
         </xs:element>

Regards,

Ren

  • Marked as answer by s u r e s h Sunday, February 01, 2015 2:58 AM
Free Windows Admin Tool Kit Click here and download it now
January 31st, 2015 10:22pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics