« iPhone TableView Control and Monotouch | Main | Loading and Unloading .Net assemblies »
Monday
Feb082010

Creating a schema and parser in 5 minutes

In this short article I will demonstrate how to create a schema and a parser object for an existing xml file
in 5 minutes.  Sometimes an application need share data with other applications or tools.  The most common way to do this is using an xml file.  This can be done in .Net using the standard tools included with the platform. 

  1. Add the xml file to the visual studio project.
  2. Open the xml file and click on the XML menu item and select the Create Schema submenu.
  3. Save the created schema and added to the project.
  4. Open a Visual Studio Command Prompt.
  5. Change directory to the director where the recently created schema file was saved.
  6. Type the following command: xsd /c schemaFileName.xsd.
  7. This command will generate a class that supports xml serialization and deserialization.
  8. Add this generated file to the project and use it for serializing and desirializing the xml file.

That is it!

Hope the helps!

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>