[Mono-bugs] [Bug 81932][Wis] New - XPathDocument can't read from XmlReader positioned at a child node
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Fri Jun 22 14:47:25 EDT 2007
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 jonpryor at vt.edu.
http://bugzilla.ximian.com/show_bug.cgi?id=81932
--- shadow/81932 2007-06-22 14:47:25.000000000 -0400
+++ shadow/81932.tmp.21543 2007-06-22 14:47:25.000000000 -0400
@@ -0,0 +1,76 @@
+Bug#: 81932
+Product: Mono: Class Libraries
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: Sys.XML
+AssignedTo: atsushi at ximian.com
+ReportedBy: jonpryor at vt.edu
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: XPathDocument can't read from XmlReader positioned at a child node
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+.NET permits XPathDocument to read from an XmlReader positioned at the top
+of any node; XPathDocument will then read only that node. From MSDN:
+
+"An XmlReader object can be used to load a whole XML document into an
+XPathDocument, or part of an XML document...."
+
+See also: http://msdn2.microsoft.com/en-us/library/w8w782f8(VS.80).aspx
+
+Attempting to do this results in an IndexOutOfBoundsFailure under Mono.
+
+Steps to reproduce the problem:
+1. Compile the attached code xmlxpd.cs: gmcs xmlxpd.cs
+2. Run it: mono xmlxpd.exe
+
+Actual Results:
+
+
+Unhandled Exception: System.IndexOutOfRangeException: Array index is out of
+range.
+ at Mono.Xml.XPath.DTMXPathDocumentBuilder2.Read () [0x00000]
+ at Mono.Xml.XPath.DTMXPathDocumentBuilder2.Compile () [0x00000]
+ at Mono.Xml.XPath.DTMXPathDocumentBuilder2.Init (System.Xml.XmlReader
+reader, XmlSpace space, Int32 defaultCapacity) [0x00000]
+ at Mono.Xml.XPath.DTMXPathDocumentBuilder2..ctor (System.Xml.XmlReader
+reader, XmlSpace space, Int32 defaultCapacity) [0x00000]
+ at Mono.Xml.XPath.DTMXPathDocumentBuilder2..ctor (System.Xml.XmlReader
+reader, XmlSpace space) [0x00000]
+ at System.Xml.XPath.XPathDocument.Initialize (System.Xml.XmlReader
+reader, XmlSpace space) [0x00000]
+ at System.Xml.XPath.XPathDocument..ctor (System.Xml.XmlReader reader,
+XmlSpace space) [0x00000]
+ at System.Xml.XPath.XPathDocument..ctor (System.Xml.XmlReader reader)
+[0x00000]
+ at Test.Main () [0x00000]
+
+
+Expected Results:
+/root/child1=<child1>
+ <nest1>
+ <nest2>hello!</nest2>
+ </nest1>
+</child1>
+<child2 />
+<child3 />
+
+The above is from .NET. I must confess that it doesn't make sense to me,
+as I would expect it to contain *only* the <child1/> element and its
+children, and not the elements following <child1/> (as the XmlReader is
+positioned on the <child1/> element). Regardless, and Exception is NOT thrown.
+
+How often does this happen?
+Always.
+
+Additional Information:
More information about the mono-bugs
mailing list