Mono Class Library: System.Xml.XmlTextWriter Overview | Members

System.Xml.XmlTextWriter.WriteDocType Method

Writes the document type declaration with the specified name and optional attributes.

public override void WriteDocType (string name, string pubid, string sysid, string subset)

Parameters

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.

Exceptions

TypeReason
ArgumentException

name is null or string.Empty.

-or-

The value for name would result in invalid XML.

InvalidOperationExceptionThis method was called outside the prolog (after the root element).

Remarks

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).

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0