开发者

How to correct a xml file based on a xml schema?

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 ?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜