This documentation is archived and is not being maintained.
XmlTextWriter Constructor (Stream, Encoding)
.NET Framework 1.1
Creates an instance of the XmlTextWriter class using the specified stream and encoding.
[Visual Basic] Public Sub New( _ ByVal w As Stream, _ ByVal encoding As Encoding _ ) [C#] public XmlTextWriter( Stream w, Encoding encoding ); [C++] public: XmlTextWriter( Stream* w, Encoding* encoding ); [JScript] public function XmlTextWriter( w : Stream, encoding : Encoding );
Parameters
- w
- The stream to which you want to write.
- encoding
- The encoding to generate. If encoding is a null reference (Nothing in Visual Basic) it writes out the stream as UTF-8 and omits the encoding attribute from the ProcessingInstruction.
Exceptions
| Exception Type | Condition |
|---|---|
| ArgumentException | The encoding is not supported or the stream cannot be written to. |
| ArgumentNullException | w is a null reference (Nothing in Visual Basic). |
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
XmlTextWriter Class | XmlTextWriter Members | System.Xml Namespace | XmlTextWriter Constructor Overload List
Show: