[Mono-list] Re: XmlDocument Load method bug ?

Atsushi Eno ginga@kit.hi-ho.ne.jp
Wed, 10 Dec 2003 01:21:43 +0900


This is a multi-part message in MIME format.
--------------060100030402060201060903
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Hello,

Hmm, then please try this patch for XmlUrlResolver.cs (in fact it is 
nothing but reverting the latest fix, maybe needed because of recent Uri 
behavior change). Sorry to say, but today and tomorrow I had and will 
have little time to test enough. That tricky code block was added when I 
received the same or similar problem related to this problem.

Thanks,
Atsushi Eno

Francisco Figueiredo Jr. wrote:
> Atsushi Eno wrote:
> 
>>>> After installing today's mono daily I've reinstalled monodoc and I 
>>>> get this error (I guess this is from XmlDocument.Load Method):
>>>
>>>
>>> Some people reported similar bug. Looks the latest System.Uri has 
>>> some problem. First I'll file a bugzilla, and then, look into that 
>>> problem.
>>
>>
>>
>> Now fixed in cvs.
>>
> 
> Hi Atsushi.
> 
> Thanks for the fix.
> 
> Monodoc is working again, but I still get errors with NAnt.
> It seems that it eats up the /home in the path.
> 
> Here is the stack trace I get when trying to build NAnt from cvs with 
> latest mono and mcs from cvs:
> 
> Note that the path is missing the /home part.
> 
> 
> System.IO.FileNotFoundException: Could not find file 
> "/fxjr/Desenvolvimento/CVSRepositories/nant/NAnt.build"
> in <0x002fa> System.IO.FileStream:.ctor 
> (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,bool) 
> 
> in <0x00043> System.IO.FileStream:.ctor 
> (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
> in <0x00081> (wrapper remoting-invoke-with-check) 
> System.IO.FileStream:.ctor 
> (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
> in <0x0014c> System.Xml.XmlUrlResolver:GetEntity 
> (System.Uri,string,System.Type)in <0x00110> 
> Mono.Xml.Native.XmlInputStream:.ctor 
> (string,bool,System.Xml.XmlResolver,string)
> in <0x0008f> (wrapper remoting-invoke-with-check) 
> Mono.Xml.Native.XmlInputStream:.ctor 
> (string,bool,System.Xml.XmlResolver,string)
> in <0x00036> Mono.Xml.Native.XmlStreamReader:.ctor 
> (string,bool,System.Xml.XmlResolver,string)
> in <0x00018> Mono.Xml.Native.XmlStreamReader:.ctor 
> (string,System.Xml.XmlResolver,string)
> in <0x0007b> (wrapper remoting-invoke-with-check) 
> Mono.Xml.Native.XmlStreamReader:.ctor 
> (string,System.Xml.XmlResolver,string)
> in <0x0003b> System.Xml.XmlTextReader:.ctor 
> (string,System.Xml.XmlNameTable)
> in <0x00039> System.Xml.XmlTextReader:.ctor (string)
> in <0x00195> NAnt.Core.LocationMap:Add (System.Xml.XmlDocument)
> in <0x00076> NAnt.Core.Project:InitializeProjectDocument 
> (System.Xml.XmlDocument)
> in <0x00270> NAnt.Core.Project:Execute ()
> in <0x00173> NAnt.Core.Project:Run ()
> 
> 
> Thanks in advance.
> 
> Francisco Figueiredo Jr.
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
> 


--------------060100030402060201060903
Content-Type: text/plain;
 name="XmlUrlResolver.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="XmlUrlResolver.patch"

Index: XmlUrlResolver.cs
===================================================================
RCS file: /cvs/public/mcs/class/System.XML/System.Xml/XmlUrlResolver.cs,v
retrieving revision 1.13
diff -u -r1.13 XmlUrlResolver.cs
--- XmlUrlResolver.cs	7 Dec 2003 15:03:54 -0000	1.13
+++ XmlUrlResolver.cs	9 Dec 2003 16:09:27 -0000
@@ -76,12 +76,11 @@
 					relativeUri.StartsWith ("file:"))
 					return new Uri (relativeUri);
 				else
-					return new Uri (Path.GetFullPath (relativeUri));
-
-				// extraneous "/a" is required because current Uri stuff 
-				// seems ignorant of difference between "." and "./". 
-				// I'd be appleciate if it is fixed with better solution.
-//				return new Uri (new Uri (Path.GetFullPath ("./a")), EscapeRelativeUriBody (relativeUri));
+					// extraneous "/a" is required because current Uri stuff 
+					// seems ignorant of difference between "." and "./". 
+					// I'd be appleciate if it is fixed with better solution.
+//					return new Uri (Path.GetFullPath (relativeUri));
+					return new Uri (new Uri (Path.GetFullPath ("./a")), EscapeRelativeUriBody (relativeUri));
 			}
 
 			if (relativeUri == null)

--------------060100030402060201060903--