這是我運行命令:使用XSD.EXE生成C#文件,收到錯誤和警告
xsd.exe -c -l:c# D:\Documents\DEV\SARPilot\Docs\schemas\06-141r2\06-141r2.xsd
這是我得到的錯誤:
Microsoft (R) Xml Schemas/DataTypes support utility
[Microsoft (R) .NET Framework, Version 2.0.50727.3038]
Copyright (C) Microsoft Corporation. All rights reserved.
Schema validation warning: Undefined complexType 'http://www.opengis.net/sps/0:ParameterDescriptorType' is used as a base for comp
lex type extension. Line 617, position 2.
Schema validation warning: Undefined complexType 'http://www.opengis.net/ows:GetCapabilitiesType' is used as a base for complex ty
pe extension. Line 23, position 2.
Schema validation warning: Undefined complexType 'http://www.opengis.net/ows:CapabilitiesBaseType' is used as a base for complex t
ype extension. Line 35, position 2.
Schema validation warning: The 'http://www.opengis.net/gml:Point' element is not declared. Line 869, position 2.
Schema validation warning: The 'http://www.opengis.net/gml:Polygon' element is not declared. Line 870, position 2.
Schema validation warning: The 'http://www.opengis.net/gml:Rectangle' element is not declared. Line 871, position 2.
Schema validation warning: The 'http://www.opengis.net/sps/0:Parameter' element is not declared. Line 381, position 2.
Schema validation warning: The 'http://www.opengis.net/sps/0:ID' element is not declared. Line 451, position 2.
Warning: Schema could not be validated. Class generation may fail or may produce incorrect results.
Error: Error generating classes for schema 'D:\Documents\DEV\SARPilot\Docs\schemas\06-141r2\06-141r2'.
- The datatype 'http://www.opengis.net/ows:GetCapabilitiesType' is missing.
If you would like more help, please type "xsd /?".
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin>
的XSD文件從附錄A複製/粘貼到以下文檔中: http://services.eoportal.org/portal/documents/06-141r2_Ordering_Services_for_Earth_Observation_Products_0.9.2.pdf
我在本地添加了所有文件,包括那些文件正在調用的文件。但是,同樣的錯誤。我很確定我的問題是錯誤:缺少數據類型'http://www.opengis.net/ows:GetCapabilitiesType'。 – capdragon 2010-12-20 19:07:41
您是否將所有模式添加到相同的文件夾?我看到的'import'語句在不同目錄級別引用了這些附加模式。由於路徑問題,您可能仍然無法找到引用的模式。 – pmartin 2010-12-20 19:38:25
您可以將它們添加到命令行並保持「提示路徑」不變。只要提到每個導入的模式(以及如果再次導入,沖洗和重複)。 xsd.exe/c TopSchema.xsd ImportSchema1.xsd ... ImportOfImportSchema1.xsd – 2010-12-20 19:39:05