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

How to create objects derived from XML

P: n/a
Hello!

I have somewhere read that it is possible to create automatically .NET
classes describing the structure of an XML file.

I would like to read an XML file, which will be deserialized in proper C#
classes.

Does someone know links for me which steps must be performed to do such
things?

Regards,
Norbert
Apr 26 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Norbert Pürringer wrote:
I have somewhere read that it is possible to create automatically .NET
classes describing the structure of an XML file.

I would like to read an XML file, which will be deserialized in proper C#
classes.

Does someone know links for me which steps must be performed to do such
things?
The .NET framework SDK comes with a tool named xsd.exe which can do
various things, it can infer an XSD schema from an XML instance document
and once you have a schema it can infer C# or VB.NET source code with
class definitions matching the schema.
See <http://msdn2.microsoft.com/en-us/library/x6c1kb0s(VS.80).aspx>.
Once you have the class definition as .NET code you are able to compile
it and use System.Xml.XmlSerialization.XmlSerializer to deserialize an
XML instance document into .NET objects.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Apr 27 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.