XDocument.Parse fails due to resolution error, how to disable resolution

Posted by Frank Krueger on Stack Overflow See other posts from Stack Overflow or by Frank Krueger
Published on 2010-05-24T18:23:30Z Indexed on 2010/05/24 18:41 UTC
Read the original article Hit count: 294

Filed under:
|
|
|

I am trying to parse the contents of http://feeds.feedburner.com/riabiz using XDocument.Parse(string) (because it gets cached in a DB.)

However, it keeps failing with the below stack trace when it tries to resolve some URIs in that XML.

I don't care about validation or any of that XML nonsense, I just want the structure parsed. How can I use XDocument without this URI resolution?

System.ArgumentException: The specified path is not of a legal form (empty).
  at System.IO.Path.InsecureGetFullPath (System.String path) [0x00000] in
:0 
  at System.IO.Path.GetFullPath (System.String path) [0x00000] in :0 
  at System.Xml.XmlResolver.ResolveUri (System.Uri baseUri, System.String
relativeUri) [0x00000] in :0 
  at System.Xml.XmlUrlResolver.ResolveUri (System.Uri baseUri, System.String
relativeUri) [0x00000] in :0 
  at Mono.Xml2.XmlTextReader.ReadStartTag () [0x00000] in :0 
  at Mono.Xml2.XmlTextReader.ReadContent () [0x00000] in :0 
  at Mono.Xml2.XmlTextReader.Read () [0x00000] in :0 
  at System.Xml.XmlTextReader.Read () [0x00000] in :0 
  at Mono.Xml.XmlFilterReader.Read () [0x00000] in :0 
  at Mono.Xml.XmlFilterReader.Read () [0x00000] in :0 
  at System.Xml.XmlReader.ReadEndElement () [0x00000] in :0 
  at System.Xml.Linq.XElement.LoadCore (System.Xml.XmlReader r, LoadOptions
options) [0x00000] in :0 
  at System.Xml.Linq.XNode.ReadFrom (System.Xml.XmlReader r, LoadOptions
options) [0x00000] in :0 
... 

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET