Is there a way to make XmlDocument parsing less strict

Posted by Istrebitel on Stack Overflow See other posts from Stack Overflow or by Istrebitel
Published on 2012-04-16T11:21:29Z Indexed on 2012/04/16 11:28 UTC
Read the original article Hit count: 211

Filed under:
|
|

I am making a program that will store its data in an XML file. When people write XML they can make subtle mistakes, like ending a comment with - so it looks like <!-- comment ---> or adding a </>inside an attribute. Naturally, the XML still can be read all right, but trying to input this text into XmlDocument will give a syntax error (and it wont be parsed).

Is there a way to make XmlDocument less strict and make it ignore violations of the standard that do not make the document unparseable? For example, its clear that <!-- comment ---> is still a comment even though it contains - at the end which is against the standard specification).

© Stack Overflow or respective owner

Related posts about c#

Related posts about Xml