Writes the document type declaration with the specified name and optional attributes.
- name
- A string specifying the name of the document type.
- pubid
- A string specifying the public identifier, which is an alternative to the system identifier.
- sysid
- A string specifying the system identifier, which is the URI of the DTD (document type definition) for the document.
- subset
- A string specifying a URI that contains markup declarations.
Type Reason ArgumentException name is null or string.Empty.
-or-
The value for name would result in invalid XML.
InvalidOperationException This method was called outside the prolog (after the root element).
The optional attributes, pubid, sysid, and subset, are not checked for invalid characters.
Note:A document type declaration is of the following form:
<!DOCTYPE name PUBLIC "pubid" "sysid" [subset]>
This method overrides XmlWriter.WriteDocType(string, string, string, string).
Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0