我试图设置一个新的gml特性架构,但是我认为我误解了某些名称空间。我的继承人模式:XSD架构目标名称空间
<xs:schema targetNamespace="http://localhost/dar" xmlns:gml="http://www.opengis.net/gml" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://localhost/dar">
<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gml.xsd" />
<xs:element name="Region" substitutionGroup="gml:_Feature">
<xs:complexType>
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureType">
<xs:sequence>
<xs:element name="regionId" type="xs:string" />
<xs:element name="regionName" type="xs:string" />
<xs:element ref="gml:Polygon" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
而且我的继承人测试XML文档:
<wfs:FeatureCollection xmlns="http://localhost/dar" xmlns:wfs="http://www.opengis.net/wfs"
xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://localhost/dar http://localhost/dar/DariusFeatures.xsd
http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
<gml:boundedBy>
<gml:Envelope srsName="http://www.opengis.net/gml/srs/epsg.xml#63266405">
<gml:lowerCorner>10 10</gml:lowerCorner>
<gml:upperCorner>20 20</gml:upperCorner>
</gml:Envelope>
</gml:boundedBy>
<gml:featureMember>
<Region>
<regionId>region432762</regionId>
<regionName>Southern Block</regionName>
<gml:Polygon>
<gml:exterior>
<gml:LinearRing>
<gml:coordinates>38.324,21.754 38.424,21.754 38.424,21.854 38.324,21.854 38.324,21.754 </gml:coordinates>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</Region>
</gml:featureMember>
现在的模式验证在eclipse罚款但是当我尝试验证XML文档, eclipse告诉我模式文件的目标命名空间是“null”?
可以看出我已经在localhost
上部署了架构。 任何人都可以看到我弄乱了吗?
为什么你的schema根中有xmlns =“http:// localhost/dar”? – Eric
谢谢,你的权利多数民众赞成在不需要,但它不是问题,我已经删除它,我仍然得到相同的验证错误 – user143278
您的示例是无效的,你缺少关闭' wfs:FeatureCollection> '标签。 – user27874