[Mono-bugs] [Bug 55856][Nor] New - InvalidOperationException using XmlTextReader.ReadInnerXml()

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 20 Mar 2004 09:55:59 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by gert.driesen@pandora.be.

http://bugzilla.ximian.com/show_bug.cgi?id=55856

--- shadow/55856	2004-03-20 09:55:59.000000000 -0500
+++ shadow/55856.tmp.18415	2004-03-20 09:55:59.000000000 -0500
@@ -0,0 +1,55 @@
+Bug#: 55856
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.XML
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: gert.driesen@pandora.be               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: InvalidOperationException using XmlTextReader.ReadInnerXml()
+
+When using XmlTextReader.ReadInnerXml() on an element which has no inner
+xml. eg. the namespace element in the following xml doc :
+
+<?xml version="1.0"?>
+<project>
+    <namespaces>
+        <namespace name="NAnt.Core.Util"></namespace>
+    </namespaces>
+</project>
+
+an InvalidOperationException is thrown :
+
+Unhandled Exception: System.InvalidOperationException: There was no XML
+start tag open.
+in <0x0004c> System.Xml.XmlTextWriter:WriteEndElementInternal (bool)
+in <0x00013> System.Xml.XmlTextWriter:WriteFullEndElement ()
+in <0x003d1> System.Xml.XmlWriter:WriteNode (System.Xml.XmlReader,bool)
+in <0x00162> System.Xml.XmlReader:ReadInnerXmlInternal ()
+in <0x00011> System.Xml.XmlReader:ReadInnerXml ()
+in <0x00081> XmlTextReaderTest.EntryPoint:ReadNamespaceSummaries
+(System.Xml.XmlReader)
+in <0x000dc> XmlTextReaderTest.EntryPoint:Main ()
+
+This works fine on MS.NET.
+
+I attached a repro for this issue.
+
+Another thing I noticed is that, if I change the xml doc to :
+
+<?xml version="1.0"?>
+<project>
+    <namespaces>
+        <namespace name="NAnt.Core.Util" />
+    </namespaces>
+</project>
+
+the XmlTextReader keeps looping.