Error with trying to use this XSD

  • I'm not very good at creating XSDs, but for my current project, I have to. I created the one below, but seem to be getting the error

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

    What am I doing wrong?

    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.w3schools.com" xmlns="http://www.w3schools.com" elementFormDefault="qualified">

    <xs:element name="VIConfigs">

    <xs:complexType>

    <xs:sequence>

    <xs:element name="VIConfigData" type="VIConfigDataType" maxOccurs="unbounded"/>

    </xs:sequence>

    </xs:complexType>

    </xs:element>

    <xs:complexType name="VIConfigDataType">

    <xs:complexContent>

    <xs:sequence>

    <xs:element name="Lender_ID" type="xs:int"/>

    <xs:element name="Vendor_ID" type="xs:int"/>

    <xs:element name="Product_ID" type="xs:int"/>

    <xs:element name="URLConfigs" type="URLConfigList" minOccurs="0"/>

    <xs:element name="ResourceConfigs" type="ResourceConfigList" minOccurs="0"/>

    <xs:element name="DomainConfigs" type="DomainConfigList" minOccurs="0"/>

    </xs:sequence>

    </xs:complexContent>

    </xs:complexType>

    <xs:complexType name="URLConfigList">

    <xs:sequence>

    <xs:element name="URLConfigData" type="URLConfigDataType" maxOccurs="unbounded"/>

    </xs:sequence>

    </xs:complexType>

    <xs:complexType name="URLConfigDataType">

    <xs:complexContent>

    <xs:sequence>

    <xs:element name="isOutboundOrInbound" type="AlphaNumeric255Type" minOccurs="0"/>

    <xs:element name="urlConfigEntryNumber" type="xs:int"/>

    <xs:element name="sUrlTypeName" type="AlphaNumeric255Type" minOccurs="0"/>

    <xs:element name="sTransportName" type="AlphaNumeric255Type" minOccurs="0"/>

    <xs:element name="sUrl" type="AlphaNumeric255Type" minOccurs="0"/>

    <xs:element name="sUrlDescription" type="AlphaNumeric255Type" minOccurs="0"/>

    <xs:element name="sUserName" type="AlphaNumeric255Type" minOccurs="0"/>

    <xs:element name="sPassword" type="AlphaNumeric255Type" minOccurs="0"/>

    <xs:element name="sContentType" type="AlphaNumeric255Type" minOccurs="0"/>

    <xs:element name="sHeaderList" type="AlphaNumeric255Type" minOccurs="0"/>

    <xs:element name="bNewOrderMessage" type="xs:boolean"/>

    <xs:element name="bCancelOrderMessage" type="xs:boolean"/>

    <xs:element name="bPauseOrderMessage" type="xs:boolean"/>

    <xs:element name="bReopenOrderMessage" type="xs:boolean"/>

    <xs:element name="bUpdateOrderMessage" type="xs:boolean"/>

    <xs:element name="bNewDeliverableMessage" type="xs:boolean"/>

    <xs:element name="bReopenDeliverableMessage" type="xs:boolean"/>

    <xs:element name="bCancelDeliverableMessage" type="xs:boolean"/>

    <xs:element name="bHoldDeliverableMessage" type="xs:boolean"/>

    </xs:sequence>

    </xs:complexContent>

    </xs:complexType>

    <xs:complexType name="ResourceConfigList">

    <xs:sequence>

    <xs:element name="ResourceConfigData" type="ResourceConfigDataType" maxOccurs="unbounded"/>

    </xs:sequence>

    </xs:complexType>

    <xs:complexType name="ResourceConfigDataType">

    <xs:complexContent>

    <xs:sequence>

    <xs:element name="resourceConfigEntryNumber" type="xs:int"/>

    <xs:element name="isOutboundOrInbound" type="AlphaNumeric255Type" minOccurs="0"/>

    <xs:element name="sResourceTypeName" type="AlphaNumeric255Type" minOccurs="0"/>

    <xs:element name="sResourceName" type="AlphaNumeric255Type" minOccurs="0"/>

    <xs:element name="sResourceDescription" type="AlphaNumeric255Type" minOccurs="0"/>

    <xs:element name="sResourceLocation" type="AlphaNumeric255Type" minOccurs="0"/>

    </xs:sequence>

    </xs:complexContent>

    </xs:complexType>

    <xs:complexType name="DomainConfigList">

    <xs:sequence>

    <xs:element name="DomainConfigData" type="DomainConfigDataType" maxOccurs="unbounded"/>

    </xs:sequence>

    </xs:complexType>

    <xs:complexType name="DomainConfigDataType">

    <xs:complexContent>

    <xs:sequence>

    <xs:element name="domainConfigEntryNumber" type="xs:int"/>

    <xs:element name="isOutboundOrInbound" type="AlphaNumeric255Type" minOccurs="0"/>

    <xs:element name="sDomainTypeName" type="AlphaNumeric255Type" minOccurs="0"/>

    <xs:element name="sDomainConfigName" type="AlphaNumeric255Type" minOccurs="0"/>

    <xs:element name="sDomainConfigValue" type="AlphaNumeric255Type" minOccurs="0"/>

    <xs:element name="sDomainConfigDescription" type="AlphaNumeric255Type" minOccurs="0"/>

    </xs:sequence>

    </xs:complexContent>

    </xs:complexType>

    <xs:simpleType name="AlphaNumeric255Type">

    <xs:annotation>

    <xs:documentation> Alpha Numeric field of length 255 characters</xs:documentation>

    </xs:annotation>

    <xs:restriction base="xs:string">

    <xs:maxLength value="255"/>

    </xs:restriction>

    </xs:simpleType>

    </xs:schema>

  • xs:complexContent cannot have xs:sequence as a child. You can have xs:extension or maybe xs:restriction which in turn can have xs:sequence as its child.

    http://msdn.microsoft.com/en-us/library/ms256053(v=vs.110).aspx

    Russel Loski, MCSE Business Intelligence, Data Platform

  • Can xs:complexType have xs:Sequence as a child?

  • complexType can have sequence as a sub-element. http://www.w3schools.com/schema/el_complextype.asp

    Russel Loski, MCSE Business Intelligence, Data Platform

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply