Answered by:
xsd to class generation when there are refererence xsds

Question
-
Hello,
I have question regarding that short post http://bembengarifin.wordpress.com/2009/07/14/generate-net-class-from-xsd-with-references-to-other-xsd-using-xsd-exe/
I wrote my question also there but I would like to share with you too, here is my question.
there is a small problem when you run that you get 1 class instead of 2 classes. Ok you may say what is the matter with that? I give you a scenario below.
there are 2 root xsd and 3 reference xsds
root: xsd 1 xsd 2 references: xsd A xsd B xsd C
1 has reference A,B,C
2 has reference A,B,C
when you create classes using the way you illustrated you end up with 2 class both having same properties (property definitions of A,B and C). then if you try to create a WSDL using these 2 classes, Visual Studio will warn you by saying multiple property declarations. Therefore you need to separate them in a common/shared classes again. thats a tired way of doing if you have too many xsds with same references combined.
ok, now the question is "is there anyway I can accoplish 2+3 classes generated rather than 2 classes for the scenario above?" I know some 3rd party programs doing that but they do sometimes wrong classes. good program suggestion will be appreciated too.
thanks.- Moved by Allen ZhangMicrosoft employee Monday, October 18, 2010 12:56 AM Usage on XSD.EXE tool (From:XML and the .NET Framework)
- Moved by Allen Chen - MSFT Monday, October 18, 2010 9:11 AM It's not a WCF issue (From:Windows Communication Foundation)
Wednesday, October 13, 2010 5:39 PM
Answers
-
Ask in one of these forums (depending on your context):
http://social.msdn.microsoft.com/Forums/en-US/exceldev/threads
http://social.msdn.microsoft.com/Forums/en-SG/xmlandnetfx/threads
http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/threads
http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataproviders/threads
Thanks!
Ed Price (a.k.a User Ed), SQL Server Customer Program Manager (Blog, Twitter, Wiki)
- Proposed as answer by Ed Price - MSFTMicrosoft employee Monday, December 10, 2012 3:52 AM
- Marked as answer by Zoltán HorváthMVP Monday, December 17, 2012 4:24 AM
Monday, December 10, 2012 3:52 AM
All replies
-
Hi, there:
Sounds like this is a feature request for XSD.EXE which is not covered under this forum as it only covers the usage for classes under System.Xml namespace. For better response, I will move it to WCF forum.
Thanks
Allen
Monday, October 18, 2010 12:55 AM -
Ask in one of these forums (depending on your context):
http://social.msdn.microsoft.com/Forums/en-US/exceldev/threads
http://social.msdn.microsoft.com/Forums/en-SG/xmlandnetfx/threads
http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/threads
http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataproviders/threads
Thanks!
Ed Price (a.k.a User Ed), SQL Server Customer Program Manager (Blog, Twitter, Wiki)
- Proposed as answer by Ed Price - MSFTMicrosoft employee Monday, December 10, 2012 3:52 AM
- Marked as answer by Zoltán HorváthMVP Monday, December 17, 2012 4:24 AM
Monday, December 10, 2012 3:52 AM