public static string writeStrict(XmlDocument original) { Debug.Assert(original.DocumentType == null); const string DocType = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">"; var document = (XmlDocument)original.Clone(); addHTMLStringNamespaceToRootElement(document); using (var stringWriter = new StringWriter()) { using (var textWriter = new XHTMLTextWriter(stringWriter)) { document.WriteTo(textWriter); } return DocType + stringWriter; } }
public static string writeStrict(XmlDocument original) { Debug.Assert(original.DocumentType == null); const string DocType = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">"; var document = (XmlDocument)original.Clone(); addHTMLStringNamespaceToRootElement(document); using (var stringWriter = new StringWriter()) { using (var textWriter = new XHTMLTextWriter(stringWriter)) { document.WriteTo(textWriter); } return(DocType + stringWriter); } }