Tuesday, August 26, 2008

Creating Property Class from XML : C#

If the XML structure is simple its easier to create a class file for serialisation.
This process consists of 3 steps as follows:

Go to Visual Studio 2005 -> Visual Studio Tools -> Visual Studio Command Prompt .

Let's consider our XML file name is like Menu.xml and is placed the D:/ drive,
Step 1: In the command prompt first point to the drive location where the XML file
is located for ex., in our case use the command d:
ex., C:\Program Files\Microsoft Visual Studio 8\VC>d:

Step 2: xsd Menu.xml
After this step, a file named Menu.xsd was created
Step 3: xsd Menu.xsd /classes
After this step, a file named Menu.cs was created

This Menu.cs file is the final class file contains the property classes for the XML.

No comments: