我使用下面的命令来从我的输入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