我使用下面的命令來從我的輸入XML文件相關的XSD文件 - response.xml,我的困惑是:(1)爲什麼有兩個XSD文件輸出(response.xsd和response_app1.xsd),我認爲有應該只是其中的一個產生? (2)如果我需要通過使用xsd/classes生成C#類文件,我應該使用哪個xsd文件?爲什麼XSD.EXE創建兩個.XSD文件以及如何使用它們?
我的環境:VSTS 2008 + C#+。NET 3.5的。
D:\>xsd response.xml
Microsoft (R) Xml Schemas/DataTypes support utility
[Microsoft (R) .NET Framework, Version 2.0.50727.3038]
Copyright (C) Microsoft Corporation. All rights reserved.
Writing file 'D:\response.xsd'.
這裏是我的輸入XML文件和輸出中XSD文件,
http://www.mediafire.com/file/kzzoxw0zwgq/inputoutput.zip
編輯1:
當我執行XSD response.xsd生成相關的C#類,也有錯誤消息,這裏有詳細的輸出,
D:\>xsd response.xsd /classes
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: The 'http://www.mycorp.com/Order/2009/05/mex:Items' e
lement is not declared. Line 10, position 16.
Warning: Schema could not be validated. Class generation may fail or may produce
incorrect results.
Error: Error generating classes for schema 'response'.
- The element 'http://www.mycorp.com/Order/2009/05/mex:Items' is missing.
If you would like more help, please type "xsd /?".
先前感謝, 喬治
@leppie 1.當我執行XSD response.xsd生成相關的C#類,也有錯誤消息。我已經發布在我原來的帖子編輯1部分。任何想法有什麼不對? 2.「一個人可能會引用另一個人」 - 你如何證明這一點? – George2 2009-07-05 14:06:53