Export (0) Print
Expand All

XmlWriter.WriteDocType Method

When overridden in a derived class, writes the DOCTYPE declaration with the specified name and optional attributes.

[Visual Basic]
Public MustOverride Sub WriteDocType( _
   ByVal name As String, _
   ByVal pubid As String, _
   ByVal sysid As String, _
   ByVal subset As String _
)
[C#]
public abstract void WriteDocType(
 string name,
 string pubid,
 string sysid,
 string subset
);
[C++]
public: virtual void WriteDocType(
 String* name,
 String* pubid,
 String* sysid,
 String* subset
) = 0;
[JScript]
public abstract function WriteDocType(
   name : String,
 pubid : String,
 sysid : String,
 subset : String
);

Parameters

name
The name of the DOCTYPE. This must be non-empty.
pubid
If non-null it also writes PUBLIC "pubid" "sysid" where pubid and sysid are replaced with the value of the given arguments.
sysid
If pubid is a null reference (Nothing in Visual Basic) and sysid is non-null it writes SYSTEM "sysid" where sysid is replaced with the value of this argument.
subset
If non-null it writes [subset] where subset is replaced with the value of this argument.

Exceptions

Exception Type Condition
InvalidOperationException This method was called outside the prolog (after the root element).
ArgumentException The value for name would result in invalid XML.

Remarks

This method does not check for invalid characters in pubid, sysid or subset.

Example

See WriteDocType (in the XmlTextWriter class) for an example using this method.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

XmlWriter Class | XmlWriter Members | System.Xml Namespace

Show:
© 2014 Microsoft