[Mono-bugs] [Bug 598593] New: System.NullReferenceException when trying to load an XmlDocument using an XmlTextReader.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Apr 21 13:54:05 EDT 2010


http://bugzilla.novell.com/show_bug.cgi?id=598593

http://bugzilla.novell.com/show_bug.cgi?id=598593#c0


           Summary: System.NullReferenceException when trying to load an
                    XmlDocument using an XmlTextReader.
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.6.x
          Platform: i586
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.XML
        AssignedTo: atsushi at ximian.com
        ReportedBy: nickntg at hotmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3)
Gecko/20100401 Firefox/3.6.3

When trying to load an instance of XmlDocument using an XmlTextReader I
consistently get an exception.

Code used to reproduce behavior:
Imports System

Public Class Application
    Public Shared Sub Main()    
        Dim reader as new Xml.XmlTextReader("test.xml")
        reader.WhiteSpaceHandling = Xml.WhitespaceHandling.All
        reader.MoveToContent()
        reader.Read()

        dim doc as new xml.xmldocument
        doc.load(reader)
    End Sub
End Class

XML file contents:
<?xml version="1.0" encoding="utf-8" ?> 
<Racal>
  <Ports>
    <ConsolePort value="9998" />
  </Ports>
</Racal>


Reproducible: Always

Steps to Reproduce:
1. Compile the short program.
2. Place XML contents in test.xml file in the same path as the compiled
executable.
3. Run the program.
Actual Results:  
Unhandled Exception: System.NullReferenceException: Unexpected node type
EndElement.
  at System.Xml.XmlDocument.ReadNodeCore (System.Xml.XmlReader reader)
[0x0034a] in
/usr/src/packages/BUILD/mono-2.6.3/mcs/class/System.XML/System.Xml/XmlDocument.cs:1012 
  at System.Xml.XmlDocument.ReadNode (System.Xml.XmlReader reader) [0x00032] in
/usr/src/packages/BUILD/mono-2.6.3/mcs/class/System.XML/System.Xml/XmlDocument.cs:862 
  at System.Xml.XmlDocument.Load (System.Xml.XmlReader xmlReader) [0x00019] in
/usr/src/packages/BUILD/mono-2.6.3/mcs/class/System.XML/System.Xml/XmlDocument.cs:732 
  at testXML.Application.Main () [0x00026] in
/home/nick/Projects/testXML/testXML/Application.vb:12 

Expected Results:  
XmlDocument loaded.

Running under openSUSE 11.2. Code compiled using MonoDevelop 2.2.2.

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list