I am trying load the below XML values
<?xml version="1.0" standalone="yes"?>
<Data>
<curmsg>
<event> myevent </event>
<clientid> 123456 </clientid>
<appid> 1123456 </appid>
<timestamp> December 13 2016 00:00:00 </timestamp>
<clientname> TEST ACCOUNT </clientname>
<accountnum> 123 </accountnum>
</backlink>
<key>AAAAC</key>
<fileid>1234</fileid>
<filename>LKTEST1.1</filename>
<filesize>30</filesize>
<eekey>LKTEST</eekey>
<pjobid>DFSAQE3Z4</pjobid>
<filecategory>Proceed</filecategory>
</curmsg>
</Data>
C# code:
XmlDocument xdoc = new XmlDocument();
xdoc.LoadXml(xmldata);
The above LoadXml function was throwing an exception because the <backlink> tag has only ending tag. It was working when I provided the starting tag but my requirement is I want to load the XML when tag has no starting tag (empty values).
This is invalid XML and no built-in XML tools will be able to read it.
Your options:
string.Replaceto replace broken nodes before loading it as XML (hacky, will likely break later when authors of the text file will introduce more invalid XML there).