From: Kosta A. <ko...@ko...> - 2003-04-30 00:31:39
|
Good to know its been reported. In comming up with a similar solution I did some investigating. Bascially the MS .Net implemention of the URI class does not support raw file paths as arguments. For example, the following code throws an exception in MS .Net Uri uri = new Uri("test.xml"); // throws System.UriFormatException Uri uri = new Uri("c:\test.xml"); // works Therefor, I believe the bug is with the XmlDocument class returning an invalid uri with a call to XmlDocument.BaseURI. Which in fact is calling an accessor in the XmlTextReader class. Although, I guess this is left up to the implementor of the class to figure out... oh well. Thanks. -kosta On Wed, 30 Apr 2003, Ian MacLean wrote: > Kosta, > Actually thats not quite true. Yes it returns a file path and not a > file:/// uri. However the Uri constructor should handle a raw file path > as an argument. I've reported this to the mono team. Its basically the > only thing stopping NAnt running fully on linux. I hacked around it by > prepending "file://" to every URi constructor and it all worked. I'm not > going to commit that though. Hopefully the bug in URI.parse will be > fixed soon. > > Ian > > > I noticed that the method XmlDocument.BaseURI does not > > return a valid Uri. Therefor, passing that argument into the Uri > > constructor causes an exception. > > > > --- code --- > > > > XmlDocument doc = new XmlDocument(); > > doc.Load("test.xml"); > > Uri uri = new Uri(doc.BaseURI); > > > > --- end --- > > > > The doc.BaseURI example above returns "test.xml". On MS .Net it returns > > file://full/path/test.xml > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > Nant-developers mailing list > > Nan...@li... > > https://lists.sourceforge.net/lists/listinfo/nant-developers > > > |