473,405 Members | 2,262 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

XSD Class Generation

Hi,

Can someone tell me how to generate classes from XSD files?
Is there an easy way to convert it into typed datasets etc?

Or any other suggestion is welcomed.

--

SevDer
http://www.sevder.com
Aug 23 '07 #1
13 2644
SevDer

Click right on your mouse on the surface in the IDE where the not XML
presentation of the XSD is located and choose generate dataset.

Cor

"SevDer" <se****@newsgroup.nospamschreef in bericht
news:uP**************@TK2MSFTNGP03.phx.gbl...
Hi,

Can someone tell me how to generate classes from XSD files?
Is there an easy way to convert it into typed datasets etc?

Or any other suggestion is welcomed.

--

SevDer
http://www.sevder.com
Aug 23 '07 #2
xsd.exe (for example, at a VS2005 command prompt)

e.g.

xsd my.xsd /classes /enableDataBinding
xsd my.xsd /dataset
xsd /?

Marc

Aug 23 '07 #3
Hi SevDer,

As Cor has suggested, you can use Visual Studio's built-in DataSet
generation feature to generate a typedDataset from a given xsd file.
However, in VS 2005, the supported approach is different from VS 2003(no
"generate dataset" command is available). Here is how to generate the
dataset from an xsd file in 2005:
>>>>>>>>
1. Select the xsd file in the solution explorer
2. At the Property Grid (F4) find the CustomTool property and type
MSDataSetGenerator
The typed dataset will be generated for you.
<<<<<<<<<

Also, you can use the .net framework sdk's built-in xsd.exe utility to
generate custom classes from a given xsd file in commandline. This tool
support generating both normal classes and DataSet classes:

#XML Schema Definition Tool (Xsd.exe)
http://msdn2.microsoft.com/en-us/lib...0s(VS.71).aspx

Hope this also helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Aug 23 '07 #4
check XSDObjectGen.msi for .net 1.0 also have a look at :
http://devauthority.com/blogs/ram_ma...0/03/4755.aspx

--
Sincerely
Yaron Karni
http://dotnetbible.blogspot.com/
"SevDer" wrote:
Hi,

Can someone tell me how to generate classes from XSD files?
Is there an easy way to convert it into typed datasets etc?

Or any other suggestion is welcomed.

--

SevDer
http://www.sevder.com
Aug 23 '07 #5
You, Sir, are a genius. I have spent soooo long trying to "fix" the
problem where the designer.cs files weren't being updated when I
edited my datasets. This got to the point where I ended up migrating
new and changed dataadapters to a whole new project. I've just tested
the MSDataSetGenerator option above, and it works!!! I looked at the
newer projects, and found they have this property set by default,
whereas the old ones did not - hence why they weren't regenerating.

I seriously owe you one - i figured this was a bug or something with
VS, and I've been ignored in the newsgroups when asking about it.
Many, many thanks.

Ship.
On Aug 23, 6:12 am, stch...@online.microsoft.com (Steven Cheng[MSFT])
wrote:
Hi SevDer,

As Cor has suggested, you can use Visual Studio's built-in DataSet
generation feature to generate a typedDataset from a given xsd file.
However, in VS 2005, the supported approach is different from VS 2003(no
"generate dataset" command is available). Here is how to generate the
dataset from an xsd file in 2005:

1. Select the xsd file in the solution explorer
2. At the Property Grid (F4) find the CustomTool property and type
MSDataSetGenerator
The typed dataset will be generated for you.
<<<<<<<<<

Also, you can use the .net framework sdk's built-in xsd.exe utility to
generate custom classes from a given xsd file in commandline. This tool
support generating both normal classes and DataSet classes:

#XML Schema Definition Tool (Xsd.exe)http://msdn2.microsoft.com/en-us/lib...0s(VS.71).aspx

Hope this also helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.

Aug 23 '07 #6
Hello Yaron,

This is also a great tool.
However I still have the same problem.
The problem I am experiencing is, my xsd files are including other xsd files
and as a result when converting, they are unable to find certain types which
are included in the include xsd files.
I think those tools do not work with included xsds

--

Sevket Seyalioglu
CTO
www.kbstours.com
"Yaron Karni" <ya*********@gmail.comwrote in message
news:17**********************************@microsof t.com...
check XSDObjectGen.msi for .net 1.0 also have a look at :
http://devauthority.com/blogs/ram_ma...0/03/4755.aspx

--
Sincerely
Yaron Karni
http://dotnetbible.blogspot.com/
"SevDer" wrote:
>Hi,

Can someone tell me how to generate classes from XSD files?
Is there an easy way to convert it into typed datasets etc?

Or any other suggestion is welcomed.

--

SevDer
http://www.sevder.com
Aug 23 '07 #7
i already worked with xsd with reference (using the XSDObjectGen app), so it
seems very strange.
--
Sincerely
Yaron Karni
http://dotnetbible.blogspot.com/
"SevDer" wrote:
Hello Yaron,

This is also a great tool.
However I still have the same problem.
The problem I am experiencing is, my xsd files are including other xsd files
and as a result when converting, they are unable to find certain types which
are included in the include xsd files.
I think those tools do not work with included xsds

--

Sevket Seyalioglu
CTO
www.kbstours.com
"Yaron Karni" <ya*********@gmail.comwrote in message
news:17**********************************@microsof t.com...
check XSDObjectGen.msi for .net 1.0 also have a look at :
http://devauthority.com/blogs/ram_ma...0/03/4755.aspx

--
Sincerely
Yaron Karni
http://dotnetbible.blogspot.com/
"SevDer" wrote:
Hi,

Can someone tell me how to generate classes from XSD files?
Is there an easy way to convert it into typed datasets etc?

Or any other suggestion is welcomed.

--

SevDer
http://www.sevder.com

Aug 23 '07 #8
I managed to work with it by combining included xsd.

Actually the included XSD also includes another one and I think thats where
I fail.

--

Sevket Seyalioglu
CTO
www.kbstours.com
"Yaron Karni" <ya*********@gmail.comwrote in message
news:88**********************************@microsof t.com...
>i already worked with xsd with reference (using the XSDObjectGen app), so
it
seems very strange.
--
Sincerely
Yaron Karni
http://dotnetbible.blogspot.com/
"SevDer" wrote:
>Hello Yaron,

This is also a great tool.
However I still have the same problem.
The problem I am experiencing is, my xsd files are including other xsd
files
and as a result when converting, they are unable to find certain types
which
are included in the include xsd files.
I think those tools do not work with included xsds

--

Sevket Seyalioglu
CTO
www.kbstours.com
"Yaron Karni" <ya*********@gmail.comwrote in message
news:17**********************************@microso ft.com...
check XSDObjectGen.msi for .net 1.0 also have a look at :
http://devauthority.com/blogs/ram_ma...0/03/4755.aspx

--
Sincerely
Yaron Karni
http://dotnetbible.blogspot.com/
"SevDer" wrote:

Hi,

Can someone tell me how to generate classes from XSD files?
Is there an easy way to convert it into typed datasets etc?

Or any other suggestion is welcomed.

--

SevDer
http://www.sevder.com

Aug 23 '07 #9
Thanks for your reply and the XSD fragment,

I'll perform some local test to see whether I can get some result. I'll
update you soon.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Aug 24 '07 #10
Hi SevDer,

Seems I can not get the XSD to work with out the refernced schema. How
large is it? Is it possible that you post it over internet so that I can
downloat it? Or you can send it to me through the following email(you can
package all the stuff in a zip pack):

string email = "stcheng" + "@" + "microsoft.com";

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
>>
Thanks for your reply and the XSD fragment,

I'll perform some local test to see whether I can get some result. I'll
update you soon.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Aug 28 '07 #11
Hi SevDer,

I have got your email and will have a look into the stuff. I'll update you
if I get any new finding on this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
>
Hi SevDer,

Seems I can not get the XSD to work with out the refernced schema. How
large is it? Is it possible that you post it over internet so that I can
downloat it? Or you can send it to me through the following email(you can
package all the stuff in a zip pack):

string email = "stcheng" + "@" + "microsoft.com";

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
>>>
Thanks for your reply and the XSD fragment,

I'll perform some local test to see whether I can get some result. I'll
update you soon.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
rights.
>>


Aug 31 '07 #12
Thanks Steven,

I will look forward for your response.

--
CTO
www.kbstours.com
"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:%2****************@TK2MSFTNGHUB02.phx.gbl...
Hi,

I have got your email and will have a look into the stuff. I'll update you
if I get any new finding on this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
rights.


--------------------
>>
Hi,

Seems I can not get the XSD to work with out the refernced schema. How
large is it? Is it possible that you post it over internet so that I can
downloat it? Or you can send it to me through the following email(you can
package all the stuff in a zip pack):

string email = "stcheng" + "@" + "microsoft.com";

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
rights.


--------------------
>>>>
Thanks for your reply and the XSD fragment,

I'll perform some local test to see whether I can get some result. I'll
update you soon.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
rights.
>>>


Aug 31 '07 #13
Hi SevDer,

I have performed some research on the three schemas you provided and did
found some syntax issues of them. The first problem I found is the base
type schemas doesn't have proper targetNamespace and default namespace
declared. I've included detailed info in the email sent to you. So far I
can get it to generate standard .net classes , but still encounter a error
when try generating dataset classes.

Sincerely,

Steven Cheng
Microsoft MSDN Online Support Lead

--------------------
>From: "KBSTours" <kb******@kbstours.com>
References: <uP**************@TK2MSFTNGP03.phx.gbl>
<FR**************@TK2MSFTNGHUB02.phx.gbl>
<ea**************@TK2MSFTNGP02.phx.gbl>
<gq**************@TK2MSFTNGHUB02.phx.gbl>
<Yh**************@TK2MSFTNGHUB02.phx.gbl>
<#M**************@TK2MSFTNGHUB02.phx.gbl>
>In-Reply-To: <#M**************@TK2MSFTNGHUB02.phx.gbl>
Subject: Re: XSD Class Generation
Date: Fri, 31 Aug 2007 07:59:58 -0400
Lines: 77
Message-ID: <54**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: text/plain;
format=flowed;
charset="iso-8859-1";
reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Windows Mail 6.0.6000.16480
X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6000.16480
X-MS-CommunityGroup-PostID: {5433B41B-F7B7-4F2B-B16F-BD9AFEC2BF69}
X-MS-CommunityGroup-ThreadID: 2399DCE5-C79D-47F3-B0D2-828BCCBBE4EB
X-MS-CommunityGroup-ParentID: CAAAA142-CB95-4872-B976-5EF29312A4C4
Newsgroups: microsoft.public.dotnet.languages.csharp
Path: TK2MSFTNGHUB02.phx.gbl
Xref: TK2MSFTNGHUB02.phx.gbl microsoft.public.dotnet.languages.csharp:48924
NNTP-Posting-Host: TK2MSFTNGHUB02.phx.gbl 127.0.0.1
X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

Thanks Steven,

I will look forward for your response.

--
CTO
www.kbstours.com
"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:%2****************@TK2MSFTNGHUB02.phx.gbl. ..
>Hi,

I have got your email and will have a look into the stuff. I'll update
you
>if I get any new finding on this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
rights.


--------------------
>>>
Hi,

Seems I can not get the XSD to work with out the refernced schema. How
large is it? Is it possible that you post it over internet so that I can
downloat it? Or you can send it to me through the following email(you can
package all the stuff in a zip pack):

string email = "stcheng" + "@" + "microsoft.com";

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
rights.


--------------------
>
Thanks for your reply and the XSD fragment,

I'll perform some local test to see whether I can get some result. I'll
update you soon.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
rights.
>>>>


Sep 4 '07 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Max M | last post by:
Yesterday there was an article on Slashdot: http://books.slashdot.org/article.pl?sid=03/09/04/1415210&mode=flat&tid=108&tid=126&tid=156 It is about automatic code generation. I got interrested...
0
by: Rasmus Fogh | last post by:
Someone raised the question of automatic code generation a few weeks back. And yes, we (CCPN) are using automatic Python code generation in a major way. Basically we are making data models in...
4
by: clintonG | last post by:
I'd like to know about application(s) or the name by which the following process is referred which would allow a business analyst to enter the following statements which when submitted would result...
16
by: christopher diggins | last post by:
It appears that the following is not considered a class: template<typename T> class C { }; ? So officially is this considered: a class, a template, a class template, or a template class? I...
4
by: peter | last post by:
How to create a class dynamicaly at run-time? Some documentations in MSDN say that it is feasible using the class "TypeBuilder",but I don't know how to do. Is there anyone who can help me? Sample...
4
by: Nikolay Petrov | last post by:
I am searching for an idea how to optimize some of my code. Let's say I have a class, which exposes some properties: Class Dummy1 Private m_sValue1 As String Private m_sValue2 As String...
1
by: Tyler Carver | last post by:
I have created a web reference in a 2005 web project and need to change out the generated complex class with the business oject that we have already created. In a library project there is a code...
1
by: Mani Jayadevan | last post by:
Sevket, Were you able to resolve the issue? I am facing the same problem. If you have already resolved it please let me know how you did it? Thanks Mani EggHeadCafe - .NET Developer...
6
beacon
by: beacon | last post by:
Hi everybody, I asked my professor for some practice problems to work on over the summer to prep me for Data Structures this fall and he gave me Conway's Game of Life to recreate. I haven't had...
13
by: Tony Johansson | last post by:
Hello! I read in a book and here is a question and the answer that I'm not satisfied with. When should you use the StringBuilder class instead of the String class. 1.When building a string from...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.