[Mono-bugs] [Bug 56510][Wis] New - XmlDataDocument loading stream bug

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 5 Apr 2004 17:42:59 -0400 (EDT)


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 yom@iaelu.net.

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

--- shadow/56510	2004-04-05 17:42:59.000000000 -0400
+++ shadow/56510.tmp.7100	2004-04-05 17:42:59.000000000 -0400
@@ -0,0 +1,125 @@
+Bug#: 56510
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Sys.XML
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: yom@iaelu.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: XmlDataDocument loading stream bug
+
+Description of Problem:
+Some problems occure when i try to load a xml file from a stream. For now,
+the main test on which i could get this error was when i was trying to load
+a stream to a XmlDataDocument, using a HttpResponse stream.
+But after a simple bug test with just a StreamReader and a XmlDataDocument
+i could get the same error.
+
+
+Steps to reproduce the problem:
+here is a code sample which would normally bug
+test.xml is a simple xml file, you can take whatever xml file you want or
+create one. my xml file contains data i'm using for another application but
+using another method to load it.
+
+###### CODE FROM HERE ######
+
+using System;
+using System.IO;
+using System.Data;
+using System.Xml;
+
+class MainClass
+{
+	public static void Main(string[] args)
+	{
+		StreamReader sr = new StreamReader("test.xml");
+		XmlDataDocument xdd = new XmlDataDocument();
+		
+		xdd.Load(sr);
+	}
+}
+
+###### CODE ENDS HERE ######
+
+Actual Results:
+result is clearly a crash from the little console application :
+
+###### RESULT FROM HERE ######
+
+$ mono StreamXmlBug.exe
+ 
+Unhandled Exception: System.ArgumentException: The path is not of a legal form
+Parameter name: path
+in <0x000ab> System.IO.Path:GetFullPath (string)
+in <0x000f0> System.Xml.XmlResolver:ResolveUri (System.Uri,string)
+in <0x000f8> System.Xml.XmlTextReader:.ctor (string,System.Xml.XmlNameTable)
+in <0x00037> System.Xml.XmlTextReader:.ctor (string)
+in <0x0010a> System.Xml.XmlDataDocument:Load (System.Xml.XmlReader)
+in <0x0003b> System.Xml.XmlDataDocument:Load (System.IO.TextReader)
+in <0x0005c> MainClass:Main (string[])
+
+###### RESULT ENDS HERE ######
+
+Expected Results:
+Expected result is that the xml file should be loaded into the
+XmlDataDocument object.
+
+
+How often does this happen? 
+For now, this is happening all the time, even if i try to open the
+StreamReader using the correct encoding, let's say utf-8.
+
+
+Additional Information:
+Loading a xml file from a XmlTextReader object with a XmlDataDocument
+object is working perfectly and it is working all the time, with the exact
+same xml file
+Here is a sample code :
+
+###### SAMPLE CODE FROM HERE ######
+
+using System;
+using System.Data;
+using System.IO;
+using System.Xml;
+
+class MainClass
+{
+	public static void Main(string[] args)
+	{
+		XmlTextReader xtr = new XmlTextReader("test.xml");
+		XmlDataDocument xdd = new XmlDataDocument();
+		
+		xdd.Load(xtr);
+	}
+}
+
+###### SAMPLE CODE ENDS HERE ######
+
+If you are looking for a quick xml file, here is also a sample :
+
+###### XML FILE FROM HERE ######
+
+<?xml version="1.0" encoding="utf-8"?>
+<server>
+  <conf>/opt/apache2/conf/httpd.conf</conf>
+  <status>1</status>
+  <sites>
+    <site name="Site">
+      <alias>alias</alias>
+      <path>path</path>
+      <status>1</status>
+    </site>
+  </sites>
+</server>
+
+###### XML FILE ENDS HERE ######