Tôi đang sử dụng lệnh sau để tạo tệp xsd liên quan từ tệp XML đầu vào của tôi - response.xml, sự nhầm lẫn của tôi là (1) tại sao có hai đầu ra tệp xsd (response.xsd và response_app1.xsd), tôi nghĩ có nên chỉ một trong số chúng được tạo ra? (2) Nếu tôi cần phải tạo ra tập tin lớp C# bằng cách sử dụng xsd/lớp học, mà xsd tập tin tôi nên sử dụng?Tại sao XSD.EXE tạo hai tệp .XSD và cách sử dụng chúng?
Môi trường của tôi: 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'.
Dưới đây là tập tin của tôi đầu vào XML và ouput file XSD,
http://www.mediafire.com/file/kzzoxw0zwgq/inputoutput.zip
EDIT 1:
khi tôi thực hiện response.xsd xsd để tạo ra liên quan đến lớp C#, có lỗi tin nhắn và đây là kết quả chi tiết,
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 /?".
cảm ơn trước, George
@leppie, 1. khi tôi thực hiện response.xsd xsd để tạo ra liên quan đến lớp học C#, có thông báo lỗi. Tôi đã đăng trong bài viết gốc của tôi EDIT 1 phần. Bất kỳ ý tưởng gì là sai? 2. "người ta có lẽ sẽ tham khảo cái kia" - làm sao bạn chứng minh điều này? – George2