public CreateDocumentType ( string name, string publicId, string systemId, string internalSubset ) : |
||
name | string | |
publicId | string | |
systemId | string | |
internalSubset | string | |
return |
using System.Xml; XmlDocument xmlDoc = new XmlDocument(); // Create the DocumentType node with the name and publicId XmlDocumentType docType = xmlDoc.CreateDocumentType("html", "-//W3C//DTD HTML 4.01//EN", ""); xmlDoc.AppendChild(docType);
using System.Xml; XmlDocument xmlDoc = new XmlDocument(); // Load the document xmlDoc.Load("example.xml"); // Create the DocumentType node with the name and publicId XmlDocumentType docType = xmlDoc.CreateDocumentType("html", "-//W3C//DTD HTML 4.01//EN", ""); // Insert the DocumentType node before the root element xmlDoc.InsertBefore(docType, xmlDoc.DocumentElement);Package Library: `System.Xml`.
public CreateDocumentType ( string name, string publicId, string systemId, string internalSubset ) : |
||
name | string | |
publicId | string | |
systemId | string | |
internalSubset | string | |
return |