System.Xml.XmlWriter.Create Method

Creates a new System.Xml.XmlWriter instance using the stream and System.Xml.XmlWriterSettings object.

Syntax

public static XmlWriter Create (System.IO.Stream output, XmlWriterSettings settings)

Parameters

output
The stream to which you want to write. The System.Xml.XmlWriter writes XML 1.0 text syntax and appends it to the specified stream.
settings
The System.Xml.XmlWriterSettings object used to configure the new System.Xml.XmlWriter instance. If this is null, a System.Xml.XmlWriterSettings with default settings is used.

Returns

An System.Xml.XmlWriter object.

Remarks

XmlWriter always writes a Byte Order Mark (BOM) to the underlying data stream; however, some streams must not have a BOM. To omit the BOM, create a new System.Xml.XmlWriterSettings object and set the Encoding property to be a new System.Text.UTF8Encoding object with the Boolean value in the constructor set to false.

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0