By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,247 Members | 871 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,247 IT Pros & Developers. It's quick & easy.

Need help writing proper class structure based off XSD schema.

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.