Problem loading XMLDocument with non standard tags
- by David Conde
Hi,
I have a code needed to load an XML document from a reader, something like this:
private static XmlDocument GetDocumentStream(string xmlAddress)
{
var settings = new XmlReaderSettings();
settings.DtdProcessing = DtdProcessing.Ignore;
settings.ValidationFlags = XmlSchemaValidationFlags.None;
var reader = XmlReader.Create(xmlAddress, settings);
document.Load(reader);
return document;
}
But in my XML document, I have nodes like this one:
<link rel="edit-media" title="Package"
href="Packages(Id='51Degrees.mobi',Version='0.1.11.9')/$value" />
Is to my understanding that the node should be like
<link rel="edit-media" title="Package"></link>
But, I don't create the Xml document and I certainly don't want to change it, but when I try to load the XML document, the document.Load line throws an exception. To be more specific, the XML file is the RSS source for the nuPack project.
Any ideas would be very appreaciated on how to be able to read this document properly.