確保將所有引用的模式放在cmd行上。
當我這樣做時,我收到了一堆警告。
$ xsd /c listTheatersByPostalCode.xsd yahooMovie.xsd yahooMovieCredit.xsd yahooMovieMedia.xsd yahooMoviePhoto.xsd yahooMovieTheater.xsd yahooMovieTheaterAmenity.xsd yahooMultimedia.xsd yahooUser.xsd
Microsoft (R) Xml Schemas/DataTypes support utility
[Microsoft (R) .NET Framework, Version 2.0.50727.42]
Copyright (C) Microsoft Corporation. All rights reserved.
Schema validation warning: The global element 'urn:yahoo:movie:theater:TheaterList' has already been declared. Line 6, position 4.
Schema validation warning: The global attribute 'urn:yahoo:movie:theater:id' has already been declared. Line 7, position 4.
Schema validation warning: The complexType 'urn:yahoo:movie:theater:TheaterListType' has already been declared. Line 10, position 4.
Schema validation warning: The complexType 'urn:yahoo:movie:theater:TheaterType' has already been declared. Line 19, position 4.
Schema validation warning: The complexType 'urn:yahoo:movie:theater:PostalAddressType' has already been declared. Line 32, position 4.
Schema validation warning: The complexType 'urn:yahoo:movie:theater:AmenityListType' has already been declared. Line 55, position 4.
Schema validation warning: The complexType 'urn:yahoo:movie:theater:MovieListType' has already been declared. Line 65, position 4.
Schema validation warning: The complexType 'urn:yahoo:movie:theater:MovieType' has already been declared. Line 71, position 4.
Schema validation warning: The complexType 'urn:yahoo:movie:theater:ShowsType' has already been declared. Line 82, position 4.
Warning: Schema could not be validated. Class generation may fail or may produce incorrect results.
如果我從該列表中取出yahooTheater.xsd,它工作正常。
我甚至沒有看XSD,但在我看來,xsd.exe認爲一些元素已被雙重定義。您可以通過將yahootheater.xsd與yahooTheaterAmenity.xsd結合來手動協調該問題。或者,如果您不關心舒適環境,請放棄它。
所以,拿出那個文件最終給了我相同的確切.cs文件,它只是不會拋出這些錯誤......怪異...... 雖然,所有類的部分處理是什麼? – 2009-06-30 04:29:10
呵呵? 「取出文件結束」?至於部分課程,如果你喜歡,你可以擴展它們。他們*可能*部分。他們將編譯沒有mods和沒有進一步的代碼。 – Cheeso 2009-06-30 12:49:25