473,498 Members | 2,018 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need help writing proper class structure based off XSD schema.

I am rather new to the XML and XSD world and was wondering what the code
would look like to write the following XSD items as classes in C# with all
the proper XML attributes to make them serializable. Thanks in advance.

<xsd:complexType name="Order">

<xsd:sequence>

<xsd:element ref="OrderHeader"/>

<xsd:element minOccurs="0" ref="OrderDetail"/>

<xsd:element minOccurs="0" ref="OrderSummary"/>

</xsd:sequence>

</xsd:complexType>

<xsd:element name="Order" type="Order"/>
Nov 12 '05 #1
2 1454
JTrigger,

You can find out for yourself, actually. You can run the XSD.EXE tool
(located in the framework directory) and point it to your XSD file. It will
then create C# source code based on the structure laid out by the XSD file.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"JTrigger" <jt******@nospam.nospam> wrote in message
news:u2**************@tk2msftngp13.phx.gbl...
I am rather new to the XML and XSD world and was wondering what the code
would look like to write the following XSD items as classes in C# with all
the proper XML attributes to make them serializable. Thanks in advance.

<xsd:complexType name="Order">

<xsd:sequence>

<xsd:element ref="OrderHeader"/>

<xsd:element minOccurs="0" ref="OrderDetail"/>

<xsd:element minOccurs="0" ref="OrderSummary"/>

</xsd:sequence>

</xsd:complexType>

<xsd:element name="Order" type="Order"/>

Nov 12 '05 #2
Yes, but the xsd tool does not create properties with setters and getters
properly. I tried the XSDObjectGenerator tool, but it creates uncompilable
code. I tried putting a post on that below, but have gotten no where. I
was hoping someone would provide me with proper code that I could then use
as a template to fix the improper code the XSDObjectGeneration tool created.

Thanks,
Jim

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:%2****************@TK2MSFTNGP09.phx.gbl...
JTrigger,

You can find out for yourself, actually. You can run the XSD.EXE tool
(located in the framework directory) and point it to your XSD file. It
will then create C# source code based on the structure laid out by the XSD
file.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"JTrigger" <jt******@nospam.nospam> wrote in message
news:u2**************@tk2msftngp13.phx.gbl...
I am rather new to the XML and XSD world and was wondering what the code
would look like to write the following XSD items as classes in C# with all
the proper XML attributes to make them serializable. Thanks in advance.

<xsd:complexType name="Order">

<xsd:sequence>

<xsd:element ref="OrderHeader"/>

<xsd:element minOccurs="0" ref="OrderDetail"/>

<xsd:element minOccurs="0" ref="OrderSummary"/>

</xsd:sequence>

</xsd:complexType>

<xsd:element name="Order" type="Order"/>


Nov 12 '05 #3

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

Similar topics

9
2912
by: sk | last post by:
I have an applicaton in which I collect data for different parameters for a set of devices. The data are entered into a single table, each set of name, value pairs time-stamped and associated with...
1
4117
by: dpakpaul | last post by:
Hi, I have an XSD schema where I have attributes that are declared to contain non string values such as integers etc. Take for example, this declaration - <xs:attribute name="IsThisTrue"...
2
1341
by: JTrigger | last post by:
I am rather new to the XML and XSD world and was wondering what the code would look like to write the following XSD items as classes in C# with all the proper XML attributes to make them...
1
2748
by: Miguel Isidoro | last post by:
I generated a .cs class from a .xsd schema using the xsd.exe tool from Visual Studio 2005 and noticed that is generating duplicate class declarations. This happens because of my schema structure. I...
9
1591
by: Tony Girgenti | last post by:
Hello I developed and tested a web application using VS.NET 2003, VB, .NET Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1. It uses a web form. I tried doing this without any help, but i'm...
0
1191
by: RYoung | last post by:
Hi all, Hope no one minds this long message, but I'm puzzled: --------------- The following is a shortened version of schema located at...
1
2797
by: Thomas | last post by:
Does anyone have a best practices recommendation on writing a valid XML document based on a 3rd party XML schema? I have a working solution but I would like to know if anyone has a better...
2
1640
by: nirmalc | last post by:
Question 1: XYZ Company is a Car production company. It has four factories and many distribution outlets spread across the country. The company keeps online records of the sales of its cars. It also...
2
1467
by: NITHYA LATHA | last post by:
XYZ Company is a Car production company. It has four factories and many distribution outlets spread across the country. The company keeps online records of the sales of its cars. It also creates...
0
7121
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
6993
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7162
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7197
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6881
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...
1
4899
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...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1411
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.