Advertisement
Guest User

千里ちゃん

a guest
Jul 26th, 2011
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  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: http://support.microsoft.com/kb/307379. 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.
  2.  
  3. Here's what it says at the link, in case the link ever dies:
  4.  
  5. > **Use the XDR Schema to Validate the XML Document**
  6. >>1. Modify your application so that XmlTextReader loads ProductWithXDR.xml as follows:
  7.  
  8. XmlTextReader r = new
  9. XmlTextReader("C:\\MyFolder\\ProductWithXDR.xml");
  10.  
  11. >>2. Set the ValidationType to XDR so that the validating reader performs XDR validation:
  12.  
  13. v.ValidationType = ValidationType.XDR;
  14.  
  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.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement