Wednesday, 2 May 2018

C# XML Parser

public XmlReader GetXMLReader(string xmlSource)
{
StringReader strReader = new StringReader(xmlSource);
XmlReaderSettings settings = new XmlReaderSettings();

settings.XmlResolver = new XmlUrlResolverWithCache();
//    settings.DtdProcessing = DtdProcessing.Parse;
    settings.DtdProcessing = DtdProcessing.Prohibit;
return XmlReader.Create(strReader, settings);
}