C# Class SimpleFramework.Xml.Stream.NodeReader

The NodeReader object is used to read elements from the specified XML event reader. This reads input node objects that represent elements within the source XML document. This will allow details to be read using input node objects, as long as the end elements for those input nodes have not been ended.

For example, if an input node represented the root element of a document then that input node could read all elements within the document. However, if the input node represented a child element then it would only be able to read its children.

Afficher le fichier Open project: ngallagher/simplexml Class Usage Examples

Méthodes publiques

Méthode Description
IsEmpty ( InputNode from ) : bool

This is used to determine if this input node is empty. An empty node is one with no attributes or children. This can be used to determine if a given node represents an empty entity, with which no extra data can be extracted.

IsName ( EventNode node, String name ) : bool

This is used to determine the name of the node specified. The name of the node is determined to be the name of the element if that element is converts to a valid StAX start element.

IsRoot ( InputNode node ) : 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.

NodeReader ( EventReader reader ) : System

Constructor for the NodeReader object. This is used to read XML events a input node objects from the event reader.

NodeReader ( EventReader reader ) : System.Text

Constructor for the NodeReader object. This is used to read XML events a input node objects from the event reader.

ReadElement ( InputNode from ) : InputNode

Returns the next input node from the XML document, if it is a child element of the specified input node. This essentially determines whether the end tag has been read for the specified node, if so then null is returned. If however the specified node has not had its end tag read then this returns the next element, if that element is a child of the that node.

ReadElement ( InputNode from, String name ) : InputNode

Returns the next input node from the XML document, if it is a child element of the specified input node. This essentially the same as the ReadElement(InputNode) object except that this will not read the element if it does not have the name specified. This essentially acts as a peak function.

ReadRoot ( ) : InputNode

Returns the root input node for the document. This is returned only if no other elements have been read. Once the root element has been read from the event reader this will return null.

ReadStart ( InputNode from, EventNode node ) : InputNode

This is used to convert the start element to an input node. This will push the created input node on to the stack. The input node created contains a reference to this reader. so that it can be used to read child elements and values.

ReadValue ( InputNode from ) : String

Read the contents of the characters between the specified XML element tags, if the read is currently at that element. This allows characters associated with the element to be used. If the specified node is not the current node, null is returned.

SkipElement ( InputNode from ) : void

This method is used to skip an element within the XML document. This will simply read each element from the document until the specified element is at the top of the stack. When the specified element is at the top of the stack this returns.

Method Details

IsEmpty() public méthode

This is used to determine if this input node is empty. An empty node is one with no attributes or children. This can be used to determine if a given node represents an empty entity, with which no extra data can be extracted.
public IsEmpty ( InputNode from ) : bool
from InputNode /// This is the input node to read the value from. ///
Résultat bool

IsName() public méthode

This is used to determine the name of the node specified. The name of the node is determined to be the name of the element if that element is converts to a valid StAX start element.
public IsName ( EventNode node, String name ) : bool
node EventNode /// This is the StAX node to acquire the name from. ///
name String /// This is the name of the node to check against. ///
Résultat bool

IsRoot() public méthode

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 ( InputNode node ) : bool
node InputNode
Résultat bool

NodeReader() public méthode

Constructor for the NodeReader object. This is used to read XML events a input node objects from the event reader.
public NodeReader ( EventReader reader ) : System
reader EventReader /// this is the event reader for the XML document ///
Résultat System

NodeReader() public méthode

Constructor for the NodeReader object. This is used to read XML events a input node objects from the event reader.
public NodeReader ( EventReader reader ) : System.Text
reader EventReader /// This is the event reader for the XML document. ///
Résultat System.Text

ReadElement() public méthode

Returns the next input node from the XML document, if it is a child element of the specified input node. This essentially determines whether the end tag has been read for the specified node, if so then null is returned. If however the specified node has not had its end tag read then this returns the next element, if that element is a child of the that node.
public ReadElement ( InputNode from ) : InputNode
from InputNode /// this is the input node to read with ///
Résultat InputNode

ReadElement() public méthode

Returns the next input node from the XML document, if it is a child element of the specified input node. This essentially the same as the ReadElement(InputNode) object except that this will not read the element if it does not have the name specified. This essentially acts as a peak function.
public ReadElement ( InputNode from, String name ) : InputNode
from InputNode /// This is the input node to read with. ///
name String /// This is the name expected from the next element. ///
Résultat InputNode

ReadRoot() public méthode

Returns the root input node for the document. This is returned only if no other elements have been read. Once the root element has been read from the event reader this will return null.
public ReadRoot ( ) : InputNode
Résultat InputNode

ReadStart() public méthode

This is used to convert the start element to an input node. This will push the created input node on to the stack. The input node created contains a reference to this reader. so that it can be used to read child elements and values.
public ReadStart ( InputNode from, EventNode node ) : InputNode
from InputNode /// This is the parent element for the start event. ///
node EventNode
Résultat InputNode

ReadValue() public méthode

Read the contents of the characters between the specified XML element tags, if the read is currently at that element. This allows characters associated with the element to be used. If the specified node is not the current node, null is returned.
public ReadValue ( InputNode from ) : String
from InputNode /// This is the input node to read the value from. ///
Résultat String

SkipElement() public méthode

This method is used to skip an element within the XML document. This will simply read each element from the document until the specified element is at the top of the stack. When the specified element is at the top of the stack this returns.
public SkipElement ( InputNode from ) : void
from InputNode /// this is the element to skip from the XML document ///
Résultat void