[Mono-bugs] [Bug 81382][Nor] New - file: url unable to handle relative paths

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Apr 16 01:30:43 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 lchin at erggroup.com.


--- shadow/81382	2007-04-16 01:30:43.000000000 -0400
+++ shadow/81382.tmp.15688	2007-04-16 01:30:43.000000000 -0400
@@ -0,0 +1,62 @@
+Bug#: 81382
+Product: Mono: Class Libraries
+Version: 1.2
+OS: All
+OS Details: 
+Status: NEW   
+Priority: Normal
+Component: Sys.XML
+AssignedTo: atsushi at ximian.com                            
+ReportedBy: lchin at erggroup.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: file: url unable to handle relative paths
+Description of Problem:
+As per the summary. Putting relative paths in a file: url fails under mono,
+but works under .NET.
+The bug occurs when validating an xml file using XmlValidatingReader. If
+the xml file contains a 'file://' url as its DTD locator, mono will be
+unable to locate the DTD file and fails the validation. .NET succeeds when
+given the same inputs.
+Steps to reproduce the problem:
+<!DOCTYPE testfile SYSTEM "file:./testdtd.dtd">
+2. C# Validator:
+try {
+    XmlTextReader xmltr = new XmlTextReader("xmltest.xml");
+    XmlValidatingReader xmlvr = new XmlValidatingReader(xmltr);
+    xmlvr.ValidationType = ValidationType.DTD;
+    // parse all nodes
+    while (xmlvr.Read());
+} catch (XmlSchemaException ex) {
+    Console.WriteLine("Error: {0}", ex.Message);
+// no exceptions, so must be valid
+Console.WriteLine("Validated file");
+Actual Results:
+System.UriFormatException: Invalid URI: The hostname could not be parsed.
+  at System.Uri.Parse (System.String uriString) [0x00000]
+  at System.Uri.ParseUri () [0x00000]
+  at System.Uri.Parse () [0x00000]
+Expected Results:
+Works on .NET -> "Validated file"
+How often does this happen? 

More information about the mono-bugs mailing list