In C#:
I have a set of rows of text (that should be XML) that are sent to a function to be added to an XML document. Each row is a simple block like these 3 examples:
<AAA f="1" g="3"> </AAA>
<AAA f="2" g="2"> </AAA>
<AAA f="3" g="3"> </AA <-- Oops a bad one!
I need to check each row to see if it is valid XML before I accept it into a full XML document as some rows are bad, but we want all the good ones.
ROW1: good
ROW2: good
ROW3: bad
ROW4: good
In this case we need ROW1,2 and 4 only.
So, how do I check to see if the row string is valid XML when it is not a full document?