T
tomldn
Hi, I have the following code:
XmlTextReader reader = new XmlTextReader(@"C:\XMLTraining
\books.xml");
while (reader.Read())
{
if (reader.HasValue)
{
Debug.WriteLine("Name:" + reader.Name);
Debug.WriteLine("Depth:" + reader.Depth);
Debug.WriteLine("Value:" + reader.Value);
Debug.WriteLine("------");
}
}
Which reads this file:
<bookstore>
<book genre="autobiography" publicationdate="1981"
ISBN="1-861003-11-0">
<title>The Autobiography of Benjamin Franklin</title>
<author>
<first-name>Benjamin</first-name>
<last-name>Franklin</last-name>
</author>
<price>8.99</price>
</book>
</bookstore>
But the Name is always "", never "book", "author" etc. I know I'm
doing something dumb - anyone know what???
Cheers,
Tom
XmlTextReader reader = new XmlTextReader(@"C:\XMLTraining
\books.xml");
while (reader.Read())
{
if (reader.HasValue)
{
Debug.WriteLine("Name:" + reader.Name);
Debug.WriteLine("Depth:" + reader.Depth);
Debug.WriteLine("Value:" + reader.Value);
Debug.WriteLine("------");
}
}
Which reads this file:
<bookstore>
<book genre="autobiography" publicationdate="1981"
ISBN="1-861003-11-0">
<title>The Autobiography of Benjamin Franklin</title>
<author>
<first-name>Benjamin</first-name>
<last-name>Franklin</last-name>
</author>
<price>8.99</price>
</book>
</bookstore>
But the Name is always "", never "book", "author" etc. I know I'm
doing something dumb - anyone know what???
Cheers,
Tom