bugDotGNU Portable.NET - Bugs: bug #11326, XmlUrlResolver.ResolveUri() works...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #11326: XmlUrlResolver.ResolveUri() works incorrectly without a path name or full URI

Submitter:  Marcus Urban <mathpup>
Submitted:  Thu 16 Dec 2004 01:22:06 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Thu 16 Dec 2004 02:17:29 AM UTC, comment #1: 

Problem is, "classQChar.xml" is not a valid Uri format (it's relative, not absolute), and so we have to expand it to a absolute Uri format before calling the Uri ctor.

Fixed in CVS December 16 2004.

Carl-Adam Brengesjo <ptah>
Group Member
Thu 16 Dec 2004 01:22:06 AM UTC, original submission:  

This problem is actually more general than it might appear at first. I first encountered problems when calling xmlDocument.Load("classQChar.xml"), resulting in the exception

Uncaught exception: System.ArgumentNullException: Argument cannot be null
Parameter name: absoluteUri
        at System.Xml.XmlUrlResolver.GetEntity(Uri, String, Type) in ./XmlUrlResolver.cs:49
        at System.Xml.XmlTextReader..ctor(String, XmlNameTable) in ./XmlTextReader.cs:302
        at System.Xml.XmlTextReader..ctor(String)
        at System.Xml.XmlDocument.Load(String) in ./XmlDocument.cs:664
        at API.AddAPIFromFile(String)
        at ApiGe.Main(String[])

XmlTextReader..ctor(String) calls resolver.ResolveUri(null, string), where string is the file that was to be loaded. In the case above, "classQChar.xml". However, ResolveUri() returns null for this string. That seems to be the real problem. Under MS.NET, it appears that the filename is expanded to its full path (if it is not of the form whatever://moreStuff).

In the test case attached, MS reports "uri is not null", whereas Pnet reports "uri is null".


Marcus Urban <mathpup>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #2226:  xml-read.cs added by mathpup (272B - text/x-csharp - Test case)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 7 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-12-28 ptah StatusNone Fixed
    Open/ClosedOpen Closed
2004-12-19 ptah StatusFixed None
    Open/ClosedClosed Open
2004-12-16 ptah StatusNone Fixed
    Open/ClosedOpen Closed
2004-12-16 mathpup Attached File- Added xml-read.cs, #1977

Back to the top

Powered by Savane 3.13-4b48.
Corresponding source code