AnsweredAssumed Answered

I am looking to paste or import an XSD into another XSD

Question asked by gouthamr388096 on Jul 15, 2018
Latest reply on Jul 15, 2018 by brianbrinley

I have an XSd like below

<xs:schema xmlns="xxxx" xmlns:b="xxxxxxx" targetNamespace="xxxxxx" xmlns:xs="xxx" elementFormDefault="qualified">
<xs:element name="UniversalInterchange">
   <xs:complexType>
      <xs:sequence>
         <xs:element name="Header">
         <xs:complexType>
      <xs:sequence>
         <xs:element name="SenderID" type="xs:string" />
         <xs:element name="RecipientID" type="xs:string" />
      </xs:sequence>
   </xs:complexType>
   </xs:element>
   <xs:element name="Body">
   <xs:complexType>
   <xs:sequence>
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip" /> - Here I was to import another XSD
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="version" type="xs:token" />
</xs:complexType>
</xs:element>
</xs:schema>

 

That other XSD is like below and my idea is to include this under the Body element of the above XML.

 

<xs:schema targetNamespace="xxx" version="1.1" elementFormDefault="qualified" xmlns="xxx" xmlns:xs="xxx">
<xs:include schemaLocation="UniversalCommon.xsd" />

<xs:element name="UniversalShipment" type="UniversalShipmentData" />

<xs:complexType name="UniversalShipmentData">
<xs:all>
<xs:element name="Shipment" type="Shipment"/>
</xs:all>
<xs:attribute name="version" type="xs:token" />
</xs:complexType>

<xs:complexType name="Shipment">
<xs:all>
<xs:element name="DataContext" minOccurs="0" type="DataContext" />

<xs:element name="ActualChargeable" minOccurs="0" type="xs:decimal" />
<xs:element name="AdditionalTerms" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="AgentsReference" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="35" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="AviationSecurityInspectionType" minOccurs="0" type="CodeDescriptionPair" />
<xs:element name="AWBServiceLevel" minOccurs="0" type="CodeDescriptionPair" />
<xs:element name="BookingConfirmationReference" minOccurs="0">

 

 

I know we could use import feature to do it, but I do not seem to be successful at all.

Outcomes