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
Afficher le fichier Open project: ngallagher/simplexml Class Usage Examples

Méthodes publiques

Méthode 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 méthode

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
Résultat void

GetChild() public méthode

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

GetPrefix() public méthode

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
Résultat String

GetPrefix() public méthode

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

IsCommitted() public méthode

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
Résultat bool

IsRoot() public méthode

public IsRoot ( ) : bool
Résultat bool

OutputDocument() public méthode

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. ///
Résultat System

Remove() public méthode

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
Résultat void

SetAttribute() public méthode

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. ///
Résultat OutputNode