根据架构文件(XSD 文件)验证 XML 文件时出现问题

Problem validating XML file against schema file ( XSD file )

分配给我的任务是根据已构建的 XSD 文件验证 XML 消息 当我尝试使用 "javax.xml.validation.Validator" 来验证 xml 时,我收到以下错误,表明模式

出错

SCHEMA : src-resolve: Cannot resolve the name 'sau:abstractPayloadType' to a(n) 'type definition' component.

这里是名为 "GIMREQ.xsd"

的架构文件
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:cm="http://www.saudiedi.com/schema/common" xmlns:sau="http://www.saudiedi.com/schema/sau"  targetNamespace="http://www.saudiedi.com/schema/sau" elementFormDefault="qualified" attributeFormDefault="qualified">
    <xsd:import namespace="http://www.saudiedi.com/schema/common" schemaLocation="../Common/common.xsd"/>
    <xsd:simpleType name="agencyIdType">
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="99999999"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="agencyNameType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="100"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="msgType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="6"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="docType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="3"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="docNoType">
        <xsd:restriction base="xsd:string">
            <xsd:pattern value="\c{1,3}\d{1,14}"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="transportType">
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="99"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="localPortCodeType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="100"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:complexType name="localPort">
        <xsd:simpleContent>
            <xsd:extension base="sau:localPortCodeType">
                <xsd:attribute name="value" use="required">
                    <xsd:simpleType>
                        <xsd:restriction base="sau:transportType"/>
                    </xsd:simpleType>
                </xsd:attribute>
            </xsd:extension>
        </xsd:simpleContent>
    </xsd:complexType>
    <xsd:complexType name="reqAgencyInfoType">
        <xsd:sequence>
            <xsd:element name="custRegPortCode" type="sau:localPort"/>
            <xsd:element name="agencyId" type="sau:agencyIdType"/>
            <xsd:element name="agencyName" type="sau:agencyNameType"/>
            <xsd:element name="requestDate" type="xsd:date"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="reqBusinessInfoType">
        <xsd:sequence>
            <xsd:element name="reqDocRefNo" type="cm:docRefNoType"/>
            <xsd:element name="reqAccID" type="cm:acctIdType"/>
            <xsd:element name="reqMSGType" type="sau:msgType"/>
            <xsd:element name="reqDocType" type="sau:docType"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="reqGeneralInfoType">
        <xsd:sequence>
            <xsd:element name="reqDocNo" type="sau:docNoType"/>
            <xsd:element name="reqMSG" type="xsd:string"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="gimReqInfoType">
        <xsd:complexContent>
            <xsd:extension base="sau:abstractPayloadType">
                <xsd:sequence>
                    <xsd:element name="reqAgencyInfo" type="sau:reqAgencyInfoType" maxOccurs="999"/>
                    <xsd:element name="reqBusinessInfo" type="sau:reqBusinessInfoType" minOccurs="0" maxOccurs="999"/>
                    <xsd:element name="reqGeneralInfo" type="sau:reqGeneralInfoType" minOccurs="0" maxOccurs="999"/>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>
    <!-- SaudiEdi Framework -->
    <xsd:complexType name="saudiediGimReqType">
        <xsd:complexContent>
            <xsd:restriction base="sau:saudiEDIType">
                <xsd:sequence>
                    <xsd:element name="record" type="sau:recordType" maxOccurs="999"/>
                </xsd:sequence>
                <xsd:attribute name="docType" use="required" fixed="GIM"/>
                <xsd:attribute name="id" type="sau:msgIDType" use="required"/>
                <xsd:attribute name="msgType" use="required" fixed="GIMREQ"/>
            </xsd:restriction>
        </xsd:complexContent>
    </xsd:complexType>
    <xsd:element name="saudiEDI" type="sau:saudiediGimReqType"/>
</xsd:schema>

这里是导入的架构文件,名为 "common.xsd"

<xsd:schema targetNamespace="http://www.saudiedi.com/schema/common" xmlns:cm="http://www.saudiedi.com/schema/common" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sau="http://www.saudiedi.com/schema/sau" elementFormDefault="qualified" attributeFormDefault="qualified">
    <xsd:import namespace="http://www.saudiedi.com/schema/sau" schemaLocation="saudiedi.xsd"/>
    <xsd:simpleType name="transportType">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="0"/>
            <xsd:enumeration value="1"/>
            <xsd:enumeration value="2"/>
            <xsd:enumeration value="3"/>
            <xsd:enumeration value="4"/>
            <xsd:enumeration value="5"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="foreignPortCodeType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="3"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="localPortCodeType">
        <xsd:restriction base="xsd:positiveInteger">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="999"/>
        </xsd:restriction>
    </xsd:simpleType>
    <!-- Updated by mantesh for CR# 21527 -->
    <xsd:simpleType name="harmonizedCodeType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="16"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:complexType name="foreignPort">
        <xsd:simpleContent>
            <xsd:extension base="cm:foreignPortCodeType">
                <xsd:attribute name="type" use="required">
                    <xsd:simpleType>
                        <xsd:restriction base="cm:transportType"/>
                    </xsd:simpleType>
                </xsd:attribute>
            </xsd:extension>
        </xsd:simpleContent>
    </xsd:complexType>
    <xsd:complexType name="localPort">
        <xsd:simpleContent>
            <xsd:extension base="cm:localPortCodeType">
                <xsd:attribute name="type" use="required">
                    <xsd:simpleType>
                        <xsd:restriction base="cm:transportType"/>
                    </xsd:simpleType>
                </xsd:attribute>
            </xsd:extension>
        </xsd:simpleContent>
    </xsd:complexType>
    <xsd:simpleType name="docRefNoType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="14"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="acctIdType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="4"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="percentageType">
        <xsd:restriction base="xsd:positiveInteger">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="100"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:complexType name="emptyPayloadType">
        <xsd:complexContent>
            <xsd:extension base="sau:abstractPayloadType">
                <xsd:sequence>
                    <xsd:element name="empty" minOccurs="0"/>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>
    <xsd:simpleType name="seaMafNoType">
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="999999"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="seaBLSeqNoType">
        <xsd:restriction base="xsd:double">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="99999.999"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="seaBLNoType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="25"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="seaMafImportType">
        <xsd:restriction base="xsd:int">
            <xsd:enumeration value="1"/>
            <xsd:enumeration value="4"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="seaMafType">
        <xsd:restriction base="xsd:long">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="5"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="ownerArbNameType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="200"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="containerSeqNoType">
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="9999"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="itemSeqNoType">
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="9999"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="agentNoType">
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="9999"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="countryCodeType">
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="0"/>
            <xsd:maxInclusive value="999"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="repNoType">
        <xsd:restriction base="xsd:long">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="9999999999"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:complexType name="repInfoType">
        <xsd:sequence>
            <xsd:element name="repNo" type="cm:repNoType"/>
            <xsd:element name="localRepRegistrationPort" type="cm:localPort"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:simpleType name="reqMsgIdType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="17"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="portContractorCodeType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="3"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="dischargeAreaType">
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="99"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="importerNoType">
        <xsd:restriction base="xsd:long">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="9999999999"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="dONoType">
        <xsd:restriction base="xsd:long">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="9999999999"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="trfMafNoType">
        <xsd:restriction base="xsd:long">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="9999999999"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:group name="dOReferenceGroup">
        <xsd:sequence>
            <xsd:element name="localRegPort" type="cm:localPort"/>
            <xsd:element name="shippingAgentNo" type="cm:agentNoType"/>
            <xsd:element name="dONo" type="cm:dONoType"/>
            <xsd:element name="dODate" type="xsd:date"/>
        </xsd:sequence>
    </xsd:group>
    <!-- Record reference key -->
    <!-- minOccurs added by Vittal Sakaray -->
    <xsd:complexType name="dOAmeReferenceType">
        <xsd:sequence>
            <xsd:element name="acctId" type="cm:acctIdType" minOccurs="0"/>
            <xsd:element name="docRefNo" type="cm:docRefNoType" minOccurs="0"/>
            <xsd:group ref="cm:dOReferenceGroup"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="dOSubReferenceType">
        <xsd:sequence>
            <xsd:element name="acctId" type="cm:acctIdType" minOccurs="0"/>
            <xsd:element name="docRefNo" type="cm:docRefNoType" minOccurs="0"/>
            <xsd:group ref="cm:dOReferenceGroup"/>
        </xsd:sequence>
    </xsd:complexType>
    <!-- Added for release 1.1 -->
    <xsd:simpleType name="frgMafNoType">
        <xsd:restriction base="xsd:long">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="99999999"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="grossWeightType">
        <xsd:restriction base="xsd:double">
            <xsd:minInclusive value="0.0001"/>
            <xsd:maxInclusive value="999999999999.9999"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="ownerEngNameType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="60"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="packageCodeType">
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="999"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="totalNoOfContainersType">
        <xsd:restriction base="xsd:long">
            <xsd:minInclusive value="0"/>
            <xsd:maxInclusive value="9999"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="containerNoType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="25"/>
            <xsd:pattern value="[a-zA-Z]{4}\s\d{4,20}"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="containerTypeCode">
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="999"/>
        </xsd:restriction>
    </xsd:simpleType>
    <!-- Added by Mantesh for PA/PC CR-->
    <xsd:simpleType name="containerType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="10"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="containerHeightType">
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="9999"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="containerLengthType">
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="99"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="temperatureType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="0"/>
            <xsd:maxLength value="5"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="temperatureUOMType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="3"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="marksAndNoType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="200"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tonnageType">
        <xsd:restriction base="xsd:double">
            <xsd:minInclusive value="0.001"/>
            <xsd:maxInclusive value="999999999.999"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="dischargeStatusType">
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="9"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="buyerNameType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="50"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="consigneeAdrsType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="175"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="packageType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="3"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="stcNumberType">
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="99999999"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="stcUOMType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="3"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tarifType">
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="99"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="imgdCodeType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="10"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="ArbMarksAndNoType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="60"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="portINTLCodeType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="5"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="portINTLType">
        <xsd:restriction base="xsd:integer">
            <xsd:enumeration value="1"/>
            <xsd:enumeration value="2"/>
            <xsd:enumeration value="3"/>
            <xsd:enumeration value="4"/>
            <xsd:enumeration value="5"/>
            <xsd:enumeration value="6"/>
        </xsd:restriction>
    </xsd:simpleType>
    <!-- EOD by Mantesh for PA/PC CR -->
    <xsd:simpleType name="totalWeightType">
        <xsd:restriction base="xsd:double">
            <xsd:minInclusive value="0.0001"/>
            <xsd:maxInclusive value="9999999999999999.9999"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="generalDescType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="200"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="noOfPackagesType">
        <xsd:restriction base="xsd:double">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="999999999999.9999"/>
        </xsd:restriction>
    </xsd:simpleType>
    <!-- Removed the Enumeration type to Integer type [25-Jan-2016] -->
    <xsd:simpleType name="customsGoodsType">
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="99"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="dangerousCodeType">
        <xsd:restriction base="xsd:string">
            <xsd:pattern value="1|2"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="goodsArbDescType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="200"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="itemMarksAndChassisNoType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="22"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="tareWeightType">
        <xsd:restriction base="xsd:double">
            <xsd:minInclusive value="0.0001"/>
            <xsd:maxInclusive value="999999999999.9999"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="vehicleTransactionRefNoType">
        <xsd:restriction base="xsd:long">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="999999999999999"/>
        </xsd:restriction>
    </xsd:simpleType>
    <!-- Added for release 1.11 -->
    <!-- Added for release 1.12 Increase the foreign manifest type from 1 to 2 digits -->
    <xsd:simpleType name="frgMafType">
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="99"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="frgMafWeight">
        <xsd:restriction base="xsd:double">
            <xsd:minInclusive value="0.01"/>
            <xsd:maxInclusive value="999999999.99"/>
        </xsd:restriction>
    </xsd:simpleType>
    <!-- export Data Type declaration starts -->
    <xsd:simpleType name="seaMafExportType">
        <xsd:restriction base="xsd:int">
            <xsd:enumeration value="2"/>
        </xsd:restriction>
    </xsd:simpleType>
    <!-- export Data Type declaration ends -->
    <xsd:simpleType name="identicalCertificateISNType">
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="0"/>
            <xsd:maxInclusive value="9999999"/>
        </xsd:restriction>
    </xsd:simpleType>
    <!-- Added by DO request CR Nagoor -->
    <xsd:simpleType name="deofees">
        <xsd:restriction base="xsd:double">
            <xsd:minInclusive value="0.01"/>
            <xsd:maxInclusive value="999999999.99"/>
        </xsd:restriction>
    </xsd:simpleType>
    <!-- EOA By DO request CR Nagoor -->
    <!-- Added by DEC Clearance CR Nagoor -->
    <xsd:simpleType name="DeptType">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="0"/>
            <xsd:maxLength value="999"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="itemMark">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="0"/>
            <xsd:maxLength value="10"/>
        </xsd:restriction>
    </xsd:simpleType>
    <!-- EOA by DEC Clearance CR Nagoor -->
    <!-- Added for Export and Statistical Shipment Information -->
    <xsd:simpleType name="itemMarkEDECSDC">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="0"/>
            <xsd:maxLength value="22"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="totalWeightEDECSDC">
        <xsd:restriction base="xsd:double">
            <xsd:minInclusive value="0.001"/>
            <xsd:maxInclusive value="999999999999999.999"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="totalQuantityEDECSDC">
        <xsd:restriction base="xsd:double">
            <xsd:minInclusive value="0.0001"/>
            <xsd:maxInclusive value="999999999999999.9999"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="shipmentTypeEDECSDC">
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="99"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="containerTypeCodeEDECSDC">
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="99"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="goodsWeightEDECSDC">
        <xsd:restriction base="xsd:double">
            <xsd:minInclusive value="0.001"/>
            <xsd:maxInclusive value="999999999999999.999"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="goodsQuantityEDECSDC">
        <xsd:restriction base="xsd:double">
            <xsd:minInclusive value="0.0001"/>
            <xsd:maxInclusive value="9999999999999999.9999"/>
        </xsd:restriction>
    </xsd:simpleType>
    <!-- EOA for Export and Statistical Shipment Information -->
</xsd:schema>

这里是名为 "saudiedi.xsd"

的导入模式
<xs:schema targetNamespace="http://www.saudiedi.com/schema/sau" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:sau="http://www.saudiedi.com/schema/sau" xmlns:cm="http://www.saudiedi.com/schema/common">
    <xs:import namespace="http://www.saudiedi.com/schema/common" schemaLocation="common.xsd"/>
    <xs:complexType name="abstractPayloadType" abstract="true">
        <xs:annotation>
            <xs:documentation>abstract payload for domain teams to define</xs:documentation>
        </xs:annotation>
    </xs:complexType>

    <xs:simpleType name="msgIDType">
        <xs:restriction base="xs:string">
            <xs:pattern value="\c{1,3}\d{1,14}"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="recordType">
        <xs:sequence>       
            <xs:element name="payload" type="sau:abstractPayloadType"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="saudiEDIType" abstract="true" block="extension">
        <xs:annotation>
            <xs:documentation>boilerplate for saudiedi documents</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="record" type="sau:recordType" maxOccurs="999"/>
        </xs:sequence>
        <xs:attribute name="docType" use="optional"/>
        <xs:attribute name="id" type="sau:msgIDType" use="optional"/>
        <xs:attribute name="msgType" use="optional"/>       
    </xs:complexType>


</xs:schema>

抽象类型 'sau:abstractPayloadType' 在 saudiedi.xsd 中定义。但是saudiedi.xsd在主xsd中不是importedincluded所以无法解析。

主要xsd导入common.xsd,common.xsd导入saudiedi.xsd。这不会使 saudiedi.xsd 中的定义可用于主要 xsd.

您的选择是:

  • include saudiedi.xsd 主要 xsd。您不能 import 它因为它与主 xsd.
  • 具有相同的目标名称空间
  • 将 saudiedi.xsd 和 import 的目标命名空间更改为主 xsd(并修复引用以引用新命名空间)