XML Schema Include Problem (XSD)

admin

Administrator
Staff member
I have two schemas "ADDRESS" and "ORDER_SUMMARY". I want to include the Address Schema at a certain place in the Order Summary schema, but the way I have it now seems to be invalid. Does anybody know how to do this?

***** ADDRESS SCHEMA *****

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" id="ADDRESS">

<xs:element name="ADDRESS">
<xs:complexType>
<xs:sequence>

<xs:element name="ADDR_STREETA" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="ADDR_STREETB" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="ADDR_CITY" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="ADDR_STATE" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="ADDR_ZIP_CODE" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="ADDR_COUNTY" type="xs:string" minOccurs="0" maxOccurs="1"/>

</xs:sequence>
</xs:complexType>
</xs:element>

</xs:schema>


***** ORDER SUMMARY SCHEMA *****

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" id="ORDER_SUMMARY">

<xs:element name="COMPANIES">
<xs:complexType>
<xs:choice maxOccurs="unbounded">

<xs:element name="COMPANY_NAME" type="xs:string" minOccurs="0" maxOccurs="1"/>

<xs:include schemaLocation="ADDRESS.xsd"/>

<xs:element name="FEDERAL_TAX_ID_NUMBER" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="NUMBER_OF_EMPLOYEES" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="FILE_ESTABLISHED_DATE" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="CONTACT_LAST_NAME" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="CONTACT_FIRST_NAME" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="CONTACT_PHONE_NUMBER" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="FAX_NUMBER" type="xs:string" minOccurs="0" maxOccurs="1"/>

</xs:choice>
</xs:complexType>
</xs:element>

<xs:element name="TOTALS">
<xs:complexType>
<xs:sequence maxOccurs="1">

<xs:element name="START_DATE" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="END_DATE" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="NUMBER_OF_COMPANIES" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="NUMBER_OF_ORDERS" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="TOTAL_AMOUNT_OF_ORDERS" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="AVG_AMOUNT_OF_ORDERS" type="xs:string" minOccurs="0" maxOccurs="1"/>

</xs:sequence>
</xs:complexType>
</xs:element>

</xs:schema>

***** ***** *****

Thanks!

akosz
 
Back
Top