c# - How to determine if XML has unclosed strings -


i have many xml files , of them might have unclosed strings this

<ns0:info infotyp="53" infoid="/> 

those unclosed strings dont appear last part of tag

is there way in notepad++ or in c# detect when file has kind of strings ?

how can detect other kind of error in xml file make invalid xml ? need try parse detect ?

with c# can try load xml file xdocument (or xmldocument):

using system.xml.linq; // include in using directives  try {     var xdoc = xdocument.load(path_to_xml); } catch (xmlexception e) {     // xml invalid      } 

xmlexception contains information line number , position caused error. exception message pretty informative. e.g. xml say:

unexpected end of file has occurred. following elements not closed: line 1, position 35.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

c++ - Clear the memory after returning a vector in a function -

erlang - Saving a digraph to mnesia is hindered because of its side-effects -