0
我試圖導入GML幾何定義的一部分進入一個新的模式文件:導入XSD只有<schema>定義,而不是<XSD:模式」
http://schemas.opengis.net/gml/3.1.1/base/geometryBasic0d1d.xsd
這是我的定義是什麼樣子:
<schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://my.namespace.com"
xmlns:my="http://my.namespace.com"
xmlns:gml="http://www.opengis.net/gml"
elementFormDefault="qualified">
<import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/geometryBasic0d1d.xsd" />
當我通過JAXB編譯運行我的XSD,我得到這個錯誤:
[WARNING] schema_reference.4: Failed to read schema document 'http://schemas.opengis.net/gml/3.1.1/base/geometryBasic0d1d.xsd', because
1) could not find the document;
2) the document could not be read;
3) the root element of the document is not <xsd:schema>.
的實況可以訪問並可以閱讀,所以它似乎是#3是問題。查看引用的xsd文件,它的根目錄不是「< xsd:schema>」,而是「< schema>」。我已經四處搜索,但找不到如何導入XSD的具體內容。但我無法想象我是唯一這樣做的人,所以我做錯了什麼?
發佈您的geometryBasic0d1d.xsd ... – Naren