a guest Jul 26th, 2011 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. You can use an XML DOM validator, or you can use the functions.  Alternatively, I found a very easy-to-follow, step-by-step tutorial, provided by Microsoft:  It tells you how to validate your XML documents in visual studio, and I was able to run it against the example code at RRUZs' link.
  3. Here's what it says at the link, in case the link ever dies:
  5. > **Use the XDR Schema to Validate the XML Document**
  6. >>1. Modify your application so that XmlTextReader loads ProductWithXDR.xml as follows:
  8.     XmlTextReader r = new
  9.     XmlTextReader("C:\\MyFolder\\ProductWithXDR.xml");
  11. >>2. Set the ValidationType to XDR so that the validating reader performs XDR validation:
  13.     v.ValidationType = ValidationType.XDR;
  15. >>3. Build and run the application. The application should report that the XML document is valid.
  16. >>4. Modify ProductWithXDR.xml to invalidate it.
  17. >>5. Build and run the application again.
  18. >>You should receive a validation error.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand