I ended up having to create my own xmlresolver class and then downloading the dtd and a bunch of mod files associated with it locally. Then rather than doing an xmldocument.load, you perform something like the below. :
XmlReaderSettings settings = new XmlReaderSettings();
settings.ValidationType = ValidationType.DTD;
settings.ProhibitDtd = false;
settings.XmlResolver = new MyCoolResolver();
binDirectory = binDirectory + "/content";
string myFileLocation = binDirectory + "/MyFile.svg";
using (XmlReader reader = XmlReader.Create(myFileLocation , settings))
{
try
{
while (reader.Read())
{
_xmlDocument.Load(reader);
}
}
catch (XmlException e)
{
Console.WriteLine(e.Message);
}
}
Then your class is just something like this for your myXmlResolver class.
namespace ReallyCoolProject
{
public class MyCoolResolver : XmlUrlResolver
{
public override object GetEntity(Uri absoluteUri, string role, Type ofObjectToReturn)
{
string binDirectory = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location);
binDirectory = binDirectory + "/mods";
if (absoluteUri.OriginalString.Contains("-//W3C//DTD SVG 1.1//EN"))
{
return File.Open(binDirectory + "/svg11.dtd", FileMode.Open);
}
if (absoluteUri.OriginalString.Contains("-//W3C//ENTITIES SVG 1.1 Document Model//EN"))
{
return File.Open(binDirectory + "/svg11-model.mod", FileMode.Open);
}
//.....many many more mod files than this
}
}
}
**Personal note can't take all the credit as I took bits and pieces from a bunch of examples on the web.