我有2个XSD文件,即MECommonFields.xsd和mutationextract_pr_new.xsd。我在mutationextract_pr_new.xsd中引用了MECommonFields.xsd,但我无法读取MECommonFields.xsd中的值。 我得到的错误如下: 例如:未声明formcaptiontype(在mutationextract_pr_new.xsd文件中)。
这是我的MECommonFields.xsd
print ("Hello World")
这是我的mutationextract_pr_new.xsd
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:simpleType name="nametype">
<xs:restriction base="xs:string">
<xs:maxLength value="120" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="relationshiptype">
<xs:restriction base="xs:string">
<xs:maxLength value="15" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="extentstype">
<xs:restriction base="xs:string">
<xs:maxLength value="15" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="relativenametype">
<xs:restriction base="xs:string">
<xs:maxLength value="120" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="rulecaptiontype">
<xs:restriction base="xs:string">
<xs:maxLength value="120" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="subsectioncaptiontype">
<xs:restriction base="xs:string">
<xs:maxLength value="120" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="ownertype">
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element name="ownernameline" >
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="35" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="formcaptiontype">
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="rulecaption">
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="subsectioncaption">
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="documentnametype">
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="districtlabeltype">
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="districttype">
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="taluklabeltype">
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="taluktype">
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="hoblilabeltype">
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="hoblitype">
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="villagelabeltype">
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="villagetype">
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="transactionyearlabeltype">
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="transactionyeartype">
<xs:restriction base="xs:string">
<xs:maxLength value="9" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="sourcelabeltype">
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="sourcetype">
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="mutationlabeltype">
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="mutationtypetype">
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="acquisitionlabeltype">
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="acquisitiontypetype">
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ordernumberlabeltype">
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ordernumbertype">
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="orderdatelabeltype">
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="orderdatetype">
<xs:restriction base="xs:string">
<xs:maxLength value="10" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="extentmeasurementtype">
<xs:restriction base="xs:string">
<xs:maxLength value="100" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="mrnumberlabeltype">
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="mrnumbertype">
<xs:restriction base="xs:string">
<xs:maxLength value="20" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="mutationorderdetailslabeltype">
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="mutationorderdetailstype">
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element name="mutationorderline">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="165"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="placelabeltype">
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="placetype">
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="mutationorderdatelabeltype">
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="versiontype">
<xs:sequence>
<xs:element name="versionnumber" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength fixed="true" value="15" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="mutationorderdatetype">
<xs:restriction base="xs:string">
<xs:maxLength value="10" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="signaturetexttype">
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ritexttype">
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="rihoblilabeltype">
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="rihoblitype">
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="footertype">
<xs:sequence>
<xs:element name="mutationorderdetailslabel" type="mutationorderdetailslabeltype" minOccurs="1" maxOccurs="1"/>
<xs:element name="mutationorderdetails" type="mutationorderdetailstype" minOccurs="1" maxOccurs="1"/>
<xs:element name="placelabel" type="placelabeltype" minOccurs="1" maxOccurs="1"/>
<xs:element name="place" type="placetype" minOccurs="1" maxOccurs="1"/>
<xs:element name="mutationorderdatelabel" type="mutationorderdatelabeltype" minOccurs="1" maxOccurs="1"/>
<xs:element name="mutationorderdate" type="mutationorderdatetype" minOccurs="1" maxOccurs="1"/>
<xs:element name="signaturetext" type="signaturetexttype" minOccurs="1" maxOccurs="1"/>
<xs:element name="ritext" type="ritexttype" minOccurs="1" maxOccurs="1"/>
<xs:element name="rihoblilabel" type="rihoblilabeltype" minOccurs="1" maxOccurs="1"/>
<xs:element name="rihobli" type="rihoblitype" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="surveytexttype">
<xs:restriction base="xs:string">
<xs:maxLength value="100" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="mutatatedownercaptiontype">
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="extentscaptiontype">
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="mutatedownerheadertype">
<xs:sequence>
<xs:element name="surveynocaption" type="surveytexttype" minOccurs="1" maxOccurs="1"/>
<xs:element name="mutatatedownercaption" type="mutatatedownercaptiontype" minOccurs="1" maxOccurs="1"/>
<xs:element name="extentscaption" type="extentscaptiontype" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="gomutatedownerheadertype">
<xs:sequence>
<xs:element name="surveynocaption" type="surveytexttype" minOccurs="1" maxOccurs="1"/>
<xs:element name="mutatatedownercaption" type="mutatatedownercaptiontype" minOccurs="1" maxOccurs="1"/>
<xs:element name="extentscaption" type="extentscaptiontype" minOccurs="1" maxOccurs="1"/>
<xs:element name="pattacaption" type="pattacaptiontype" minOccurs="1" maxOccurs="1"/>
<xs:element name="revenuecaption" type="revenuecaptiontype" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="pattacaptiontype">
<xs:restriction base="xs:string">
<xs:maxLength value="20" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="revenuecaptiontype">
<xs:restriction base="xs:string">
<xs:maxLength value="20" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="newownercaption">
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="officerremarkstype">
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="newownercaptiontype">
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="newownerheadertype">
<xs:sequence>
<xs:element name="newownercaption" type="newownercaptiontype" minOccurs="1" maxOccurs="1"/>
<xs:element name="extentscaption" type="extentscaptiontype" minOccurs="1" maxOccurs="1"/>
<xs:element name="officerremarks" type="officerremarkstype" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="transactionnumberlabeltype">
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="transactionnumbertype">
<xs:restriction base="xs:string">
<xs:maxLength value="9" />
</xs:restriction>
</xs:simpleType>
</xs:schema>
有任何帮助吗?谢谢。
答案 0 :(得分:0)
在两个XSD中,xs:schema
元素都具有以下属性:
targetNamespace="http://www.w3.org/2001/XMLSchema"
这不是你想要的。如果受管理的XML在命名空间中,targetNamespace
应该是由XSD管理的XML的命名空间,而不是XSD命名空间;否则,targetNamespace
属性应该不存在。