Name
XmlWriter
Synopsis
This class is a fast writer used to output XML
data to a stream or file. Two methods
work with input from an XmlReader object to
produce output from the currently positioned node.
WriteAttributes( ) outputs all the
node’s attributes. WriteNode( )
dumps the entire current node to the output stream and moves the
XmlReader to the next node.
The remaining Write* methods of this class take
string arguments that are output as properly formed XML markup. For
example, WriteComment( ) takes a string and
outputs it within <!-- ... --> markup.
WriteStartAttribute( ) and
WriteStartElement( ) provide some flexibility when
writing elements and attributes. These two methods provide the
opening contents of each type, given the name, prefix, and namespace.
The next call can then provide the value of the element or attribute
by other means. For example, you can use WriteString( ) for a simple string value, or another
WriteStartElement( ) to begin a child element.
WriteEndAttribute( ) and WriteEndElement( ) close the writing.
The derived XmlTextWriter class provides
formatting functionality to the output data.
public abstract class XmlWriter {
// Protected Constructors
protected XmlWriter( );
// Public Instance Properties
public abstract WriteState WriteState{get; }
public abstract string XmlLang{get; }
public abstract XmlSpace XmlSpace{get; }
// Public Instance Methods
public abstract void Close( );
public abstract void Flush( );
public abstract string LookupPrefix(string ns ...