hi all,
I am trying to figure out of the CreateDocumentType() works in C# and although i have already found and read the msdn page on it, i can not get it to work for me.
I am simply trying to create this line in my xml document:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Can someone help me out with the syntax required for this
EDIT: code so far, with htmldoc being an xmldocument declared further up in the code.
string dtdLink = "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";
string dtdDef = "-//W3C//DTD XHTML 1.0 Transitional//EN";
XmlDocumentType docType = htmlDoc.CreateDocumentType("html", "PUBLIC", dtdLink, dtdDef);
htmlDoc.AppendChild(docType);
This does NOT work.