I've a xml file with partial whitespace;
<file>
<document>
<data>1</data>
<data>2</data>
<data>3</data>
</document><document> //whitespace missing
<data>1</data>
<data>2</data>
<data>3</data>
</document>
</file>
When i use XmlTextReader to read the xml file and use the following code to find an element;
XmlTextReader reader = new XmlTextReader(xmlFile);
while (reader.Read())
{
{
if (reader.NodeType == XmlNodeType.Element)
it doesn't find the second element <document>
(caused by the reader position)
How can i change my code to read all elements.
As a workaround i now write a temporary file replacing ><
with >\n<