views:

48

answers:

1

There are a lot of files that have changed unintentionally and now they don't match their related schema.

What I want to do is to find the errors and to correct them automatically (if possible). I looked at the validation mechanism available in .NET framework. The problem is I don't know how I can edit the erroneous node.The validation event handler gives me an event argument that has some information about the error itself but not the node and a sender object that is an object of type XmlValidationReaderImpl which I don't know anything about and I couldn't find any information about this type anywhere.

Does anybody know how I can correct a Xml file using validation mechanism or if there are any other approaches available ?

+2  A: 

I am not sure about using the validation mechanism, but if the errors are simplistic in form you could always edit and correct them in raw text. You can do this by using filestreams. If you would like to explore this further let me know. Maybe you could post some examples of what it looks like, and what its supposed to look like. I might be able to write the function for you to correct these in no time.

Jimmie Clark