Monday, February 7, 2011

How to validate an XML file against a schema using Visual Studio 2005

Is it possible to validate an xml file against it's associated schema using Visual Studio 2005 IDE?

I could only see options to create a schema based on the current file, or show the XSLT output

alt text

  • Okay just remembered it's done automatically, errors appear as warnings in the "Error List" and are additionally underlined with the blue squiggle in the source file.

    Not sure if there is another way to validate the file, but this will do for now.

    Jimmy Chandra : As long as your xml schema is set to the schema file, it should validate it automatically and any error will be detected. You'll get the benefit of XML intellisense as well if you have a schema associated with the xml.
  • XmlSchemaValidator

    Warning: It's not pretty to use.

    Edward Wilde : I should have clarified I wanted to use the IDE and not code.
    From Dan Blair

0 comments:

Post a Comment