Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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.
- Here's what it says at the link, in case the link ever dies:
- > **Use the XDR Schema to Validate the XML Document**
- >>1. Modify your application so that XmlTextReader loads ProductWithXDR.xml as follows:
- XmlTextReader r = new
- XmlTextReader("C:\\MyFolder\\ProductWithXDR.xml");
- >>2. Set the ValidationType to XDR so that the validating reader performs XDR validation:
- v.ValidationType = ValidationType.XDR;
- >>3. Build and run the application. The application should report that the XML document is valid.
- >>4. Modify ProductWithXDR.xml to invalidate it.
- >>5. Build and run the application again.
- >>You should receive a validation error.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement