EPTXmlTextParserWrite Method (Stream, Encoding) Content Studio 5.7 SDK
Content Studio Web Content Management System

[This is preliminary documentation and is subject to change.]

Writes the full Xml content of the Ept document to the supplied System.IO.Stream using the supplied encoding.

Namespace: ContentStudio.Document.EPT
Assembly: CSServer5 (in CSServer5.dll) Version: 5.7.5016.0 (5.7.5016.0)

public void Write(
	Stream output,
	Encoding encoding


Type: System.IOStream
A Stream to write to.
Type: System.TextEncoding
The Encoding to use when writing to the stream

Note Note
The caller must ensure that the stream is disposed after usage. No attempt is made to move the position of the stream when the writing is finished. For example; if a MemoryStream is used the stream will be at the end position after the write operation.

The following code sample shows how to write xml to a string using the default encoding

 private string GetXml(EPTXmlTextParser ept)
   using (System.IO.MemoryStream ms = new System.IO.MemoryStream())
      ept.Write(ms, Encoding.Default);
      ms.Position = 0;
      System.IO.StreamReader sr = new System.IO.StreamReader(ms, Encoding.Default);
      return sr.ReadToEnd();
See Also