[Mono-list] XML Read() statement

Daniel Morgan danmorg@sc.rr.com
Thu, 20 Feb 2003 03:53:54 -0500


I haven't used XmlTextReader, so I don't know for sure.

You could try the file URI "file:///"

Maybe something like:
"file:///App/EBook/Glade_Ebook/Ebook.glade"

-----Original Message-----
From: mono-list-admin@lists.ximian.com
[mailto:mono-list-admin@lists.ximian.com]On Behalf Of Michael Schwery
Sent: Wednesday, February 19, 2003 5:42 PM
To: mono-list@lists.ximian.com
Subject: [Mono-list] XML Read() statement


I'm trying to read a XML file with the following code, but it keeps looking
for a url based file.
What do I have to change?

void ReadXML()
{
	string tagName;
	try
	{
		XmlTextReader reader = new
XmlTextReader("/App/EBook/Glade_Ebook/Ebook.glade");

		while (reader.Read())
		{
		tagName = reader.Name;
		if (tagName == "property")
		{
			for (int i = 0; i < reader.AttributeCount; i++)
			{
				reader.MoveToAttribute(i);
				Console.WriteLine(reader.ReadString());
				}
			}
		}


	}
	catch (System.Exception Error)
	{
		Console.WriteLine (Error.ToString());
	}

}








_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail

_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list