C# Class SimpleFramework.Xml.Stream.OutputAttribute

The OutputAttribute object is used to represent a node added to the output node map. It represents a simple name value pair that is used as an attribute by an output element. This shares its namespaces with the parent element so that any namespaces added to the attribute are actually added to the parent element, which ensures correct scoping.
Inheritance: OutputNode
Mostrar archivo Open project: ngallagher/simplexml

Public Methods

Method Description
Commit ( ) : void

The commit method is used flush and commit any child nodes that have been created by this node. This allows the output to be completed when building of the XML document has been completed. If output fails an exception is thrown.

GetChild ( String name ) : OutputNode
GetPrefix ( ) : String
GetPrefix ( bool inherit ) : String
IsCommitted ( ) : bool

This is used to determine whether the node has been committed. If the node has been committed, then this will return true. When committed the node can no longer produce child nodes.

IsRoot ( ) : bool

This method is used to determine if this node is the root node for the XML document. The root node is the first node in the document and has no sibling nodes. This is false if the node has a parent node or a sibling node.

OutputAttribute ( OutputNode source, String name, String value ) : System

Constructor for the OutputAttribute object. This is used to create a simple name value pair attribute holder.

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
ToString ( ) : String

This is used to acquire the name and value of the attribute. Implementing this method ensures that debugging the output node is simplified as it is possible to get the actual value.

Method Details

Commit() public method

The commit method is used flush and commit any child nodes that have been created by this node. This allows the output to be completed when building of the XML document has been completed. If output fails an exception is thrown.
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

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 the node has been committed. If the node has been committed, then this will return true. When committed the node can no longer produce child nodes.
public IsCommitted ( ) : bool
return bool

IsRoot() public method

This method is used to determine if this node is the root node for the XML document. The root node is the first node in the document and has no sibling nodes. This is false if the node has a parent node or a sibling node.
public IsRoot ( ) : bool
return bool

OutputAttribute() public method

Constructor for the OutputAttribute object. This is used to create a simple name value pair attribute holder.
public OutputAttribute ( OutputNode source, String name, String value ) : System
source OutputNode
name String /// this is the name that is used for the node ///
value String /// this is the value used for the node ///
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

ToString() public method

This is used to acquire the name and value of the attribute. Implementing this method ensures that debugging the output node is simplified as it is possible to get the actual value.
public ToString ( ) : String
return String