[Mono-list] XmlTextReader class problem

mirek novak mndisc at gmail.com
Fri Dec 9 10:08:52 EST 2005


Hello,

I have installed and compiled latest mono (1.1.10) on my testing
machine to check whether  Encoding property works or not. But
unfortunately it doesnt work the way I expect.

I'm including small standalone example for reproducing this error.
Can someone take a look at it to tell me where is (my) mistake?

thanks.

configuration follows
[root at kotleta ~]# mcs --version
Mono C# compiler version 1.1.10.0
[root at kotleta ~]# mono --version
Mono JIT compiler version 1.1.10, (C) 2002-2005 Novell, Inc and
Contributors. www.mono-project.com
        TLS:           __thread
        GC:            Included Boehm (with typed GC)
        SIGSEGV      : altstack
its compiled from latest sources

/// code follows ....
using System;using System.Collections;using System.IO;
using System.Text;using System.Xml;using c = System.Console;
namespace downloader {
    public class showError {
        public static string Code = "<?xml version=\"1.0\"
encoding=\"iso-8859-1\"?>\n<root>\n<node>\nvalue\n</node>\n</root>";
        static void Main(string[] args) {
	    c.WriteLine(Code);
            StringReader strReader = new StringReader(Code);
            XmlTextReader xml = new XmlTextReader(strReader);
            while (xml.Read()) {
                if (xml.ReadState == ReadState.Interactive) {
	            System.Console.WriteLine("{0} XML No error ... {1}",
DateTime.Now, xml);
	            System.Console.WriteLine("{0} XML No error even
xml.Encoding is null!(maybe feature) {1}", DateTime.Now,
xml.Encoding);
	            System.Console.WriteLine("{0} XML Error!!!",
DateTime.Now, xml.Encoding.ToString());
                }
            }
	}
    }
}

/// --- code ends ---

regards
--
Mirek


More information about the Mono-list mailing list