I am looking to design a windows form application that opens an XML file and validates the syntax, very similar to the function on this w3schools page http://www.w3schools.com/dom/dom_validate.asp
I am fairly new to using XML so any help would be greatly appreciated :)
Opening and validating XML File - WIndows form application
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Roei BarRank #1,271 · 1.4K reputationPosted Aug 25, 2009, 6:44 AM EDT
XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Async=false; xmlDoc.LoadXML(this.lblXml.Text); if(xmlDoc.ParseError.rrorCode!=0) { txt="Error Code: " + xmlDoc.ParseError.ErrorCode + "\n"; txt=txt+"Error Reason: " + xmlDoc.ParseError.reason; txt=txt+"Error Line: " + xmlDoc.ParseError.line; alert(txt); } else { lblError.Text = "No errors found"); }Michael3 reputationPosted Aug 25, 2009, 6:57 AM EDT
Where it is saying there is no definition for 'ParseError'. I am using .NET FW 2.0 btw.
Also, i would like the user to be able to choose the xml file they want to validate by using the openfiledialog.