[Mono-list] Error while run program

Arx Henrique arxcruz@yahoo.com.br
Tue, 03 Aug 2004 12:54:10 -0300


The problem was that the program can't find the xml file, now i put they
in the same directory of the program and now it's show other error:

Unhandled Exception: System.Xml.XmlException: unexpected end of file.
Current depth is 1
in <0x001ef> System.Xml.XmlTextReader:ReadContent ()
in <0x0018e> System.Xml.XmlTextReader:Read ()
in <0x007a6> System.Xml.XmlDocument:ReadNode (System.Xml.XmlReader)
in <0x002b7> System.Xml.XmlDocument:ReadNode (System.Xml.XmlReader)
in <0x0004f> System.Xml.XmlDocument:Load (System.Xml.XmlReader)
in <0x0005f> System.Xml.XmlDocument:Load (string)
in <0x0005d> DotNetXmlSample.XmlSample:Main (string[])

i search in google but i can't find nothing about this.

[]'s

Arx Henrique

Em Ter, 2004-08-03 às 11:18 +0500, Israel Fdez Cabrera escreveu:
> Check the following modifications to the example:
> 
> El Martes, 3 de Agosto de 2004 05:54 AM, Arx Henrique escribió:
> >
> > this is the code:
> >
> > using System;
> > using System.Xml;
> >
> > namespace DotNetXmlSample
> > {
> > 	public class XmlSample
> > 	{
> > 		static void Main(string[] args)
> > 		{
> > 			XmlDocument SampleDoc = new XmlDocument();
> > 			XmlNode RootNode = null;
> > 			XmlNode RegionNode = null;
> > 			XmlNode RegionDescription = null;
> > 			SampleDoc.Load("/home/ahcruz/teste.xml");
> > 			RootNode = SampleDoc.DocumentElement;
> 			if (RootNode == null)
> 				Console.WriteLine("here is your problem? malformed document?");
> > 			RegionNode = RootNode.ChildNodes[0];
> > 			RegionDescription = RootNode.SelectSingleNode("description");
> > 			RegionDescription.InnerText = "Reeeeeealy fast";
> > 			SampleDoc.Save("/home/ahcruz/teste_2.xml");
> > 		}
> > 	}
> > }
> >
> > And this is the xml file
> >
> > <?xml version="1.0"?>
> > <links>
> >   <category xmlns="prog">
> >     <address>one addres</address>
> >     <description>one description</description>
> >   </category>
> >   <category xmlns="prog2">
> >     <address>two addres</address>
> >     <description>two description</description>
> >   </category>
> > </links>
> >
> > thanks a lot of
> >
> > Arx Henrique
> >
> > _______________________________________________
> > Mono-list maillist  -  Mono-list@lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-list
>