XmlTextWriter Constructor (Stream^, Encoding^)
.NET Framework (current version)
Creates an instance of the XmlTextWriter class using the specified stream and encoding.
Assembly: System.Xml (in System.Xml.dll)
Parameters
- w
-
Type:
System.IO::Stream^
The stream to which you want to write.
- encoding
-
Type:
System.Text::Encoding^
The encoding to generate. If encoding is null it writes out the stream as UTF-8 and omits the encoding attribute from the ProcessingInstruction.
| Exception | Condition |
|---|---|
| ArgumentException | The encoding is not supported or the stream cannot be written to. |
| ArgumentNullException | w is null. |
Note |
|---|
Starting with the .NET Framework 2.0, we recommend that you create XmlWriter instances by using the XmlWriter::Create method and the XmlWriterSettings class to take advantage of new functionality. |
.NET Framework
Available since 1.1
Available since 1.1
Show:
