我試圖設置一個新的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