C# Class SimpleFramework.Xml.Stream.OutputDocument

The OutputDocument object is used to represent the root of an XML document. This does not actually represent anything that will be written to the generated document. It is used as a way to create the root document element. Once the root element has been created it can be committed by using this object.
Inheritance: OutputNode
Mostra file Open project: ngallagher/simplexml Class Usage Examples

Public Methods

Method Description
Commit ( ) : void

This will commit this element and any uncommitted elements elements that are decendents of this node. For instance if any child or grand child remains open under this element then those elements will be closed before this is closed.

GetChild ( String name ) : OutputNode
GetPrefix ( ) : String

The default for the OutputDocument is null as it does not require a namespace. A null prefix is always used by the document as it represents a virtual node that does not exist and will not form any part of the resulting XML.

GetPrefix ( bool inherit ) : String
IsCommitted ( ) : bool

This is used to determine whether this node has been committed. This will return true if no root element has been created or if the root element for the document has already been commited.

IsRoot ( ) : bool
OutputDocument ( NodeWriter writer, OutputStack stack ) : System

Constructor for the OutputDocument object. This is used to create an empty output node object that can be used to create a root element for the generated document.

Remove ( ) : void

This is used to remove any uncommitted changes. Removal of an output node can only be done if it has no siblings and has not yet been committed. If the node is committed then this will throw an exception to indicate that it cannot be removed.

SetAttribute ( String name, String value ) : OutputNode

Method Details

Commit() public method

This will commit this element and any uncommitted elements elements that are decendents of this node. For instance if any child or grand child remains open under this element then those elements will be closed before this is closed.
public Commit ( ) : void
return void

GetChild() public method

public GetChild ( String name ) : OutputNode
name String /// This is the name of the child element to create. ///
return OutputNode

GetPrefix() public method

The default for the OutputDocument is null as it does not require a namespace. A null prefix is always used by the document as it represents a virtual node that does not exist and will not form any part of the resulting XML.
public GetPrefix ( ) : String
return String

GetPrefix() public method

public GetPrefix ( bool inherit ) : String
inherit bool /// If there is no explicit prefix then inherit. ///
return String

IsCommitted() public method

This is used to determine whether this node has been committed. This will return true if no root element has been created or if the root element for the document has already been commited.
public IsCommitted ( ) : bool
return bool

IsRoot() public method

public IsRoot ( ) : bool
return bool

OutputDocument() public method

Constructor for the OutputDocument object. This is used to create an empty output node object that can be used to create a root element for the generated document.
public OutputDocument ( NodeWriter writer, OutputStack stack ) : System
writer NodeWriter /// This is the node writer to write the node to. ///
stack OutputStack /// This is the stack that contains the open nodes. ///
return System

Remove() public method

This is used to remove any uncommitted changes. Removal of an output node can only be done if it has no siblings and has not yet been committed. If the node is committed then this will throw an exception to indicate that it cannot be removed.
public Remove ( ) : void
return void

SetAttribute() public method

public SetAttribute ( String name, String value ) : OutputNode
name String /// This is the name of the attribute to be added. ///
value String /// This is the value of the node to be added. ///
return OutputNode