Reputation: 64173
I am confused about the XmlReader.Read() output. Hope someone could explain it.
It seems the XmlReader.Read() method always gives an extra blank line?
Below is my code:
public static void TestXML()
{
XmlReader r = XmlReader.Create(@"d:\snapshot_skeleton.xml");
//r.MoveToContent();
while (r.Read())
{
Console.Write(new String('.', r.Depth));
Console.WriteLine(r.Name);
}
}
Below is the output:
xml
<-----------------what is this?
person
. <-----------------what is this?
.name
.. <-----------------what is this?
.name
.
.gender
..
.gender
.
.age
..
.age
.
person
Upvotes: 0
Views: 118