Suppose you start looking at an XML file, which you parse and confirm that it in fact an XML file. Life is good.
Then someone removes a >
somewhere in a file, which effectively makes the file a malformed XML from parser's stand point. As far as it's concerned, the file is no longer a properly formed XML file.
Is there a way one can one confirm that file is in fact still an XML file, albeit a malformed one?
The question extends beyond XML (obviously). How can one arrive at a conclusion that a file is "probably of a certain type", as opposed "i can't parse it and therefore it is certainly not of a certain type"?