diff api/Exporters/WarFoundryHtmlExporter.cs @ 163:395c8042dc03

Fixes #144: HTML generation may need network connection * Use new "custom XML resolver" for HTML export * Add DTD and entity definition files for XHTML Strict
author IBBoard <dev@ibboard.co.uk>
date Sun, 04 Oct 2009 15:55:44 +0000
parents 4a02c07278e7
children 91f7b8da0b53
line wrap: on
line diff
--- a/api/Exporters/WarFoundryHtmlExporter.cs	Sun Oct 04 15:52:15 2009 +0000
+++ b/api/Exporters/WarFoundryHtmlExporter.cs	Sun Oct 04 15:55:44 2009 +0000
@@ -8,7 +8,8 @@
 using System.Text;
 using System.Xml;
 using System.Xml.Schema;
-using IBBoard.Lang;
+using IBBoard.Lang;
+using IBBoard.Xml;
 using IBBoard.WarFoundry.API.Objects;
 
 namespace IBBoard.WarFoundry.API.Exporters
@@ -37,7 +38,10 @@
 		
 		public void ExportArmy(Army army, string path)
 		{
-			XmlDocument doc = new XmlDocument();
+			XmlDocument doc = new XmlDocument();
+			CustomXmlResolver resolver = new CustomXmlResolver();
+			resolver.AddMapping("-//W3C//DTD XHTML 1.0 Strict//EN", new Uri("file://" + IBBoard.Constants.ExecutablePath + "/dtds/xhtml1-strict.dtd"));
+			doc.XmlResolver = resolver;
 			doc.AppendChild(doc.CreateDocumentType("html", "-//W3C//DTD XHTML 1.0 Strict//EN", "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd", null));
 			XmlElement html = doc.CreateElement("html");
 			doc.AppendChild(html);