Simple way to generate XSD from XML via Visual Studio

Today we had to generate an XSD file from an XML file.
Of course you can use the XML Schema Definition tool (XSD.exe) or something 3rd party (XMLSpy: Best XML editor ever made IMHO) for this.
But there is also an easy way to do this via Visual Studio.

When you open an XML file in Visual Studio a new menu item (XML) will appear.
From this menu you can do the following:

  • Create schema
  • Show XSLT Output
  • Debug XSLT
  • View available Schemas

image

Feel a little stupid that I didn’t notice this earlier. Apparently this is something that
has been there for a while.

But anyway, it’s a nice feature.