Tuesday, July 24, 2007

Visual Studio : Using a xsd to validate / create xml

With VS 2005, there's a neat feature which allows you to validate / check a xml document based on a xsd.

Load the xml document (or the bare bones) and then click the "Properties" tab on the RHS (where "Solution Explorer" is). You'll see a "schema" entry. Point this to the xsd that describes the xml.

You might need to use "file:// ... " if the file is on your hard drive.

Now you will see that all the errors are highlighted in the usual way and also Intelli-sense guides you as you build up the xml.

Enjoy!

No comments: