Saturday, October 2, 2010

Convert XML files to class files in Visual studio

xsd.exe gtest1.xsd  /cThese are the steps to convert xml files to class files in Visual Studio.

  1. Open the XML file in Visual Studio.
  2. Create Schema in the XML option.
  3. Run the Visual Studio command prompt from programs.
  4. Cd to the relevant file:
    1. cd C:\test1\test2\\xml_files
  5. To convert file
    1. xsd.exe test1.xsd  /c
  6. to convert multiple files
    1. xsd.exe test1.xsd test2.xsd  /c
  7. when converted individually lot of duplicate names had to be commented out.
  8. Easier approach use the XSD files create constructor for each item.

No comments:

Post a Comment