IGLib
1.7.2
The IGLib base library for development of numerical, technical and business applications.
|
Base class for classes taht contain an Xml document that can be parsed. Provides comfortable utilities for transversing the document and for querying the value, name, and attributes of the current node. More...
Classes | |
class | Mark |
Position mark in the XML document More... | |
Public Member Functions | |
string | Attribute (string key) |
Returns the value of the specified attribute of the current node. If the attribute does not exist then null is returned. More... | |
XmlNode | GetNode (string path) |
Returns the first node that satisfies a given XPath expression relative to the root node. It does not report any errors (just returns null in case of errors) More... | |
XmlNode | GetRelative (string path) |
Returns the first node that satisfies a given XPath expression relative to the current node. It does not report any errors. More... | |
XmlNode | GetNextNode (XmlNodeType NodeType, string NodeName, string NodeValue) |
Moves the current node to the first sibling node after the current node that satisfies the specified conditions, and returns the current node. More... | |
XmlNode | GetNextNode (XmlNodeType NodeType, string NodeName) |
Moves the current node to the first sibling node after the current node that satisfies the specified conditions, and returns the current node. More... | |
XmlNode | GetNextNode (XmlNodeType NodeType) |
Moves the current node to the first sibling node after the current node that is of the specified type. More... | |
XmlNode | GetNextNode (string NodeName, string NodeValue) |
Moves the current node to the first sibling node after the current node that satisfies the specified conditions, and returns the current node. Node type is not important. More... | |
XmlNode | GetNextNode (string NodeName) |
Moves the current node to the first sibling node after the current node that satisfies the specified conditions, and returns the current node. Node type is not important. More... | |
XmlNode | GetNextOrCurrentNode (XmlNodeType NodeType, string NodeName, string NodeValue) |
Moves the current node to the current or the first sibling node after the current node that satisfies the specified conditions, and returns the current node. More... | |
XmlNode | GetNextOrCurrentNode (XmlNodeType NodeType, string NodeName) |
Moves the current node to the current or the first sibling node after the current node that satisfies the specified conditions, and returns the current node. More... | |
XmlNode | GetNextOrCurrentNode (XmlNodeType NodeType) |
Moves the current node to the current or the first sibling node after the current node that is of the specified type. More... | |
XmlNode | GetNextOrCurrentNode (string NodeName, string NodeValue) |
Moves the current node to the current or the first sibling node after the current node that satisfies the specified conditions, and returns the current node. Node type is not important. More... | |
XmlNode | GetNextOrCurrentNode (string NodeName) |
Moves the current node to the current or the first sibling node after the current node that satisfies the specified conditions, and returns the current node. Node type is not important. More... | |
XmlNode | GetNextElement (string NodeName, string NodeValue) |
Moves the current node to the first sibling node after the current node that satisfies the specified conditions, and returns the current node. More... | |
XmlNode | GetNextElement (string NodeName) |
Moves the current node to the first sibling node after the current node that satisfies the specified conditions, and returns the current node. More... | |
XmlNode | GetNextElement () |
Moves the current node to the first sibling element after the current node. More... | |
XmlNode | GetNextOrCurrentElement (string NodeName, string NodeValue) |
Moves the current node to the current or the first sibling node after the current node that satisfies the specified conditions, and returns the current node. More... | |
XmlNode | GetNextOrCurrentElement (string NodeName) |
Moves the current node to the current or the first sibling node after the current node that satisfies the specified conditions, and returns the current node. More... | |
XmlNode | GetNextOrCurrentElement () |
Moves the current node to the current or the first sibling element after the current node. More... | |
void | SetMark (string name) |
Marks the current state of the XmlParser and sets mark name to name. Position is stored on a stack such that previous stored positions can be restored, either in a reverse way. More... | |
void | SetMark () |
Marks the current state of the XmlParser. The mark set is not named. Position is stored on a stack such that previous stored positions can be restored, either in a reverse way. More... | |
XmlNode | GoToMark (bool removemarks) |
Restores the parser state to the state contained in the last mark. The current node after operation is returned, or null if there are no marks. If required then the last mark is removed from the list. More... | |
XmlNode | GoToMark (string name, bool removemarks) |
Restores the parser state to the state contained in the last mark with the specified name. The current node after operation is returned, or null if there are no marks with such a name. If required then the targeted and all subsequent marks are removed from the list. More... | |
XmlNode | GoToMark () |
Restores the parser state to the state contained in the last mark. The current node after operation is returned, or null if there are no marks. The last mark is LEFT on the list. More... | |
XmlNode | GoToMark (string name) |
Restores the parser state to the state contained in the last mark with the specified name. The current node after operation is returned, or null if there are no marks with such a name. More... | |
XmlNode | BackToMark () |
Restores the parser state to the state contained in the last mark, and REMOVES that mark. The current node after operation is returned, or null if there are no marks. More... | |
XmlNode | BackToMark (string name) |
Restores the parser state to the state contained in the last mark with the specified name, and REMOVES all marks from that mark on (includively). The current node after operation is returned, or null if there are no marks with such a name. More... | |
XmlNode | RemoveMark () |
Removes the last mark and returns its current node. Position is not affected. More... | |
XmlNode | RemoveMarks (string name) |
Removes all marks from the last mark with the specified name on the list and returns the current node of the specified mark. Position is not affected. More... | |
XmlNode | Back () |
Moves the current to the previous node, if that node exists. Only one step backwards is enabled. More... | |
XmlNode | MoveTo (XmlNode node) |
Moves the current position to the specified node. More... | |
XmlNode | MoveTo (string path) |
Moves the current position to the first node that satisfies the absolute path specified as an XPath string. More... | |
XmlNode | MoveRelative (string path) |
Moves the current position to the first node that satisfies the relative path specified as an XPath string relative to the current node. More... | |
XmlNode | GoToParent () |
Sets the current node to the parent node of the current node and returns it. This also works if the Current node is null because the advancing fell out of range or because StepIn was executed but there were no child _gridCoordinates of the current node. More... | |
XmlNode | GoToRoot () |
Sets the current node to the root node of the current document and returns it. More... | |
XmlNode | GoToDocument () |
Sets the current node to the root node of the current document and returns it. More... | |
XmlNode | StepIn () |
Moves the current node to its first child node and returns the node. More... | |
XmlNode | StepOut () |
Steps out of the current childnodes context and selects the next node of the parent as the current node. This also works if the Current node is null because the advancing fell out of range or because StepIn was executed but there were no child _gridCoordinates of the current node. More... | |
XmlNode | NextNode () |
Sets the current node to the next sibling node, or to null if the next sibling node does not exist, and returns that node. More... | |
XmlNode | NextNodeConditional (XmlNodeType NodeType, string NodeName, string NodeValue, bool IncludeCurrent) |
Moves the current node to the first sibling node of the current node that satisfies the specified conditions, and returns the current node. More... | |
XmlNode | NextNode (XmlNodeType NodeType, string NodeName, string NodeValue) |
Moves the current node to the first sibling node after the current node that satisfies the specified conditions, and returns the current node. More... | |
XmlNode | NextNode (XmlNodeType NodeType, string NodeName) |
Moves the current node to the first sibling node after the current node that satisfies the specified conditions, and returns the current node. More... | |
XmlNode | NextNode (XmlNodeType NodeType) |
Moves the current node to the first sibling node after the current node that is of the specified type. More... | |
XmlNode | NextNode (string NodeName, string NodeValue) |
Moves the current node to the first sibling node after the current node that satisfies the specified conditions, and returns the current node. Node type is not important. More... | |
XmlNode | NextNode (string NodeName) |
Moves the current node to the first sibling node after the current node that satisfies the specified conditions, and returns the current node. Node type is not important. More... | |
XmlNode | NextOrCurrentNode (XmlNodeType NodeType, string NodeName, string NodeValue) |
Moves the current node to the current or the first sibling node after the current node that satisfies the specified conditions, and returns the current node. More... | |
XmlNode | NextOrCurrentNode (XmlNodeType NodeType, string NodeName) |
Moves the current node to the current or the first sibling node after the current node that satisfies the specified conditions, and returns the current node. More... | |
XmlNode | NextOrCurrentNode (XmlNodeType NodeType) |
Moves the current node to the current or the first sibling node after the current node that is of the specified type. More... | |
XmlNode | NextOrCurrentNode (string NodeName, string NodeValue) |
Moves the current node to the current or the first sibling node after the current node that satisfies the specified conditions, and returns the current node. Node type is not important. More... | |
XmlNode | NextOrCurrentNode (string NodeName) |
Moves the current node to the current or the first sibling node after the current node that satisfies the specified conditions, and returns the current node. Node type is not important. More... | |
XmlNode | NextElement (string NodeName, string NodeValue) |
Moves the current node to the first sibling node after the current node that satisfies the specified conditions, and returns the current node. More... | |
XmlNode | NextElement (string NodeName) |
Moves the current node to the first sibling node after the current node that satisfies the specified conditions, and returns the current node. More... | |
XmlNode | NextElement () |
Moves the current node to the first sibling element after the current node. More... | |
XmlNode | NextOrCurrentElement (string NodeName, string NodeValue) |
Moves the current node to the current or the first sibling node after the current node that satisfies the specified conditions, and returns the current node. More... | |
XmlNode | NextOrCurrentElement (string NodeName) |
Moves the current node to the current or the first sibling node after the current node that satisfies the specified conditions, and returns the current node. More... | |
XmlNode | NextOrCurrentElement () |
Moves the current node to the current or the first sibling element after the current node. More... | |
Public Member Functions inherited from IG.Lib.XmlUtilityBase | |
virtual void | SetDocument (XmlDataDocument doc) |
virtual void | Load (string filename) |
virtual void | LoadXml (string docstr) |
Static Public Member Functions | |
static XmlNode | GetNextNode (XmlNode StartingNode, XmlNodeType NodeType, string NodeName, string NodeValue, bool IncludeCurrent) |
Finds the first sibling node of the starting node (or the current node itself) that satisfies the specified conditions, and returns that node or null if such a node could not be found. This method does not report errors, it just returns null if the node satisfying conditions can not be found. More... | |
Static Public Member Functions inherited from IG.Lib.XmlUtilityBase | |
static string | GetDefaultNameSpaceUri (XmlElement element) |
Gets the default namespace URI if defined, for the specified Xml element. More... | |
static string | GetDefaultNameSpaceUri (XmlDocument doc) |
Gets the default namespace URI of teh Xml document. More... | |
static string | GetDefaultNameSpaceUri (XmlNode node) |
Returns the default namespace URI that applies to the specified Xml node. More... | |
static string | GetNameSpaceUri (XmlDocument doc, string prefix) |
Returns the namespace URI associated with a specific prefix that applies to the specified Xml document. More... | |
static string | GetNameSpaceUri (XmlNode node, string prefix) |
Returns the namespace URI associated with a specific prefix that applies to the specified Xml document. More... | |
Protected Member Functions | |
XmlNode | GoToMark (Mark mark) |
Restores the parser state that is stored in the specified mark. The current node after operation is returned, or null if mark is not specified (i.e., it is null). More... | |
Protected Member Functions inherited from IG.Lib.XmlUtilityBase | |
bool | ContainedInDocument (XmlNode node, XmlDocument doc) |
Returns true if an Xml node is contained in the specified Xml document (false if any is null). More... | |
bool | ContainedInNode (XmlNode node, XmlNode container) |
Returns null if an XML node (first argument) is contained in the specified note (second argument). The node can be contained in another node at an arbitrary depth for the function to return true. If any of the _gridCoordinates is null then the function returns false. More... | |
Properties | |
override XmlDocument | Doc [get, set] |
Xml document that represents the message. More... | |
XmlNode | Current [get, set] |
The current node on which all queries are performed. More... | |
XmlNode | Previous [get, set] |
The node that was previously set to the current node. More... | |
XmlNode | Parent [get, private set] |
Parent of Current. If Current = null then Parent can still return something, which happens in particular when StepIn was performed before. Parent can be set to a specific node. That node will be returned by Parent when the Current is null (otherwise, the parent of Current is still returned). This is useful when current becomes null, e.g. because of running out of index bounds. More... | |
XmlElement | ParentElement [get] |
XmlElement | CurrentElement [get] |
XmlElement | PreviousElement [get] |
string | Name [get] |
Returns the name of the current node. More... | |
string | Value [get] |
Returns the value of the current node. If the current node is an element then the value of its first text child element is returned. More... | |
string | InnerText [get] |
Returns the inner text of the current node. More... | |
Properties inherited from IG.Lib.XmlUtilityBase | |
virtual IG.Lib.IReporter | R [get] |
Reporter for this class. More... | |
virtual bool | HasDefaultNameSpace [get, protected set] |
string | FileName [get, protected set] |
virtual XmlDocument | Doc [get, set] |
Xml document that represents the message. More... | |
XmlNode | Root [get, private set] |
Root node of the current document. More... | |
Private Attributes | |
XmlNode | _current = null |
XmlNode | _previous = null |
XmlNode | _parent = null |
List< Mark > | marks = new List<Mark>() |
Additional Inherited Members | |
Public Attributes inherited from IG.Lib.XmlUtilityBase | |
string | DefaultNameSpace = null |
string | DefaultNameSpacePrefix = "defaultnsprefix" |
Base class for classes taht contain an Xml document that can be parsed. Provides comfortable utilities for transversing the document and for querying the value, name, and attributes of the current node.
|
inline |
Returns the value of the specified attribute of the current node. If the attribute does not exist then null is returned.
|
inline |
Returns the first node that satisfies a given XPath expression relative to the root node. It does not report any errors (just returns null in case of errors)
path | XPath expression. |
|
inline |
Returns the first node that satisfies a given XPath expression relative to the current node. It does not report any errors.
path | XPath expression. |
|
inlinestatic |
Finds the first sibling node of the starting node (or the current node itself) that satisfies the specified conditions, and returns that node or null if such a node could not be found. This method does not report errors, it just returns null if the node satisfying conditions can not be found.
StartingNode | Starting node at which the search is started. |
NodeType | If not XmlNodeType.None then the current node must have this type. |
NodeName | If not null then the current node must have this name. |
NodeValue | If not null then the current node muust have this value. |
IncludeCurrent | If true then the returned node can also be the current node (if it satisfies the conditions), otherwise the search starts at the next sibling of the current node. |
|
inline |
Moves the current node to the first sibling node after the current node that satisfies the specified conditions, and returns the current node.
NodeType | If not None then the current node must have this type. |
NodeName | If not null then the current node must have this name. |
NodeValue | If not null then the current node muust have this value. |
|
inline |
Moves the current node to the first sibling node after the current node that satisfies the specified conditions, and returns the current node.
NodeType | If not None then the current node must have this type. |
NodeName | If not null then the current node must have this name. |
|
inline |
Moves the current node to the first sibling node after the current node that is of the specified type.
NodeType | If not None then the current node must have this type. |
|
inline |
Moves the current node to the first sibling node after the current node that satisfies the specified conditions, and returns the current node. Node type is not important.
NodeName | If not null then the current node must have this name. |
NodeValue | If not null then the current node muust have this value. |
|
inline |
Moves the current node to the first sibling node after the current node that satisfies the specified conditions, and returns the current node. Node type is not important.
NodeName | If not null then the current node must have this name. |
|
inline |
Moves the current node to the current or the first sibling node after the current node that satisfies the specified conditions, and returns the current node.
NodeType | If not None then the current node must have this type. |
NodeName | If not null then the current node must have this name. |
NodeValue | If not null then the current node muust have this value. |
|
inline |
Moves the current node to the current or the first sibling node after the current node that satisfies the specified conditions, and returns the current node.
NodeType | If not None then the current node must have this type. |
NodeName | If not null then the current node must have this name. |
|
inline |
Moves the current node to the current or the first sibling node after the current node that is of the specified type.
NodeType | If not None then the current node must have this type. |
|
inline |
Moves the current node to the current or the first sibling node after the current node that satisfies the specified conditions, and returns the current node. Node type is not important.
NodeName | If not null then the current node must have this name. |
NodeValue | If not null then the current node muust have this value. |
|
inline |
Moves the current node to the current or the first sibling node after the current node that satisfies the specified conditions, and returns the current node. Node type is not important.
NodeName | If not null then the current node must have this name. |
|
inline |
Moves the current node to the first sibling node after the current node that satisfies the specified conditions, and returns the current node.
NodeName | If not null then the current node must have this name. |
NodeValue | If not null then the current node muust have this value. |
|
inline |
Moves the current node to the first sibling node after the current node that satisfies the specified conditions, and returns the current node.
NodeName | If not null then the current node must have this name. |
|
inline |
Moves the current node to the first sibling element after the current node.
|
inline |
Moves the current node to the current or the first sibling node after the current node that satisfies the specified conditions, and returns the current node.
NodeName | If not null then the current node must have this name. |
NodeValue | If not null then the current node muust have this value. |
|
inline |
Moves the current node to the current or the first sibling node after the current node that satisfies the specified conditions, and returns the current node.
NodeName | If not null then the current node must have this name. |
|
inline |
Moves the current node to the current or the first sibling element after the current node.
|
inline |
Marks the current state of the XmlParser and sets mark name to name. Position is stored on a stack such that previous stored positions can be restored, either in a reverse way.
name | Name assigned to the mark. |
References IG.Lib.XmlParser.Mark.Current, IG.Lib.XmlParser.Mark.name, IG.Lib.XmlParser.Mark.Parent, and IG.Lib.XmlParser.Mark.Previous.
|
inline |
Marks the current state of the XmlParser. The mark set is not named. Position is stored on a stack such that previous stored positions can be restored, either in a reverse way.
|
inlineprotected |
Restores the parser state that is stored in the specified mark. The current node after operation is returned, or null if mark is not specified (i.e., it is null).
mark | The mark containing the state that is restored. |
References IG.Lib.XmlParser.Mark.Current, IG.Lib.XmlParser.Mark.Parent, and IG.Lib.XmlParser.Mark.Previous.
|
inline |
Restores the parser state to the state contained in the last mark. The current node after operation is returned, or null if there are no marks. If required then the last mark is removed from the list.
removemarks | If true then all marks from the specified one on (inclusively) are removed. |
|
inline |
Restores the parser state to the state contained in the last mark with the specified name. The current node after operation is returned, or null if there are no marks with such a name. If required then the targeted and all subsequent marks are removed from the list.
name | Name of the mark whose state is restored. |
removemarks | If true then all marks from the specified one on (inclusively) are removed. |
References IG.Lib.XmlParser.Mark.name.
|
inline |
Restores the parser state to the state contained in the last mark. The current node after operation is returned, or null if there are no marks. The last mark is LEFT on the list.
|
inline |
Restores the parser state to the state contained in the last mark with the specified name. The current node after operation is returned, or null if there are no marks with such a name.
name | Name of the mark whose state is restored. |
|
inline |
Restores the parser state to the state contained in the last mark, and REMOVES that mark. The current node after operation is returned, or null if there are no marks.
|
inline |
Restores the parser state to the state contained in the last mark with the specified name, and REMOVES all marks from that mark on (includively). The current node after operation is returned, or null if there are no marks with such a name.
name | Name of the mark whose state is restored. |
|
inline |
Removes the last mark and returns its current node. Position is not affected.
References IG.Lib.XmlParser.Mark.Current.
|
inline |
Removes all marks from the last mark with the specified name on the list and returns the current node of the specified mark. Position is not affected.
References IG.Lib.XmlParser.Mark.Current, and IG.Lib.XmlParser.Mark.name.
|
inline |
Moves the current to the previous node, if that node exists. Only one step backwards is enabled.
|
inline |
Moves the current position to the specified node.
|
inline |
Moves the current position to the first node that satisfies the absolute path specified as an XPath string.
path | XPath string that specifies the node position relative to the document root. |
|
inline |
Moves the current position to the first node that satisfies the relative path specified as an XPath string relative to the current node.
path | XPath string that specifies the node position relative to the current node. |
|
inline |
Sets the current node to the parent node of the current node and returns it. This also works if the Current node is null because the advancing fell out of range or because StepIn was executed but there were no child _gridCoordinates of the current node.
|
inline |
Sets the current node to the root node of the current document and returns it.
|
inline |
Sets the current node to the root node of the current document and returns it.
|
inline |
Moves the current node to its first child node and returns the node.
|
inline |
Steps out of the current childnodes context and selects the next node of the parent as the current node. This also works if the Current node is null because the advancing fell out of range or because StepIn was executed but there were no child _gridCoordinates of the current node.
|
inline |
Sets the current node to the next sibling node, or to null if the next sibling node does not exist, and returns that node.
|
inline |
Moves the current node to the first sibling node of the current node that satisfies the specified conditions, and returns the current node.
NodeType | If not None then the current node must have this type. |
NodeName | If not null then the current node must have this name. |
NodeValue | If not null then the current node muust have this value. |
IncludeCurrent | If true then the new current node can also be the current node (if it satisfies the conditions), otherwise the search starts at the next sibling of the current node. |
|
inline |
Moves the current node to the first sibling node after the current node that satisfies the specified conditions, and returns the current node.
NodeType | If not None then the current node must have this type. |
NodeName | If not null then the current node must have this name. |
NodeValue | If not null then the current node muust have this value. |
|
inline |
Moves the current node to the first sibling node after the current node that satisfies the specified conditions, and returns the current node.
NodeType | If not None then the current node must have this type. |
NodeName | If not null then the current node must have this name. |
|
inline |
Moves the current node to the first sibling node after the current node that is of the specified type.
NodeType | If not None then the current node must have this type. |
|
inline |
Moves the current node to the first sibling node after the current node that satisfies the specified conditions, and returns the current node. Node type is not important.
NodeName | If not null then the current node must have this name. |
NodeValue | If not null then the current node muust have this value. |
|
inline |
Moves the current node to the first sibling node after the current node that satisfies the specified conditions, and returns the current node. Node type is not important.
NodeName | If not null then the current node must have this name. |
|
inline |
Moves the current node to the current or the first sibling node after the current node that satisfies the specified conditions, and returns the current node.
NodeType | If not None then the current node must have this type. |
NodeName | If not null then the current node must have this name. |
NodeValue | If not null then the current node muust have this value. |
|
inline |
Moves the current node to the current or the first sibling node after the current node that satisfies the specified conditions, and returns the current node.
NodeType | If not None then the current node must have this type. |
NodeName | If not null then the current node must have this name. |
|
inline |
Moves the current node to the current or the first sibling node after the current node that is of the specified type.
NodeType | If not None then the current node must have this type. |
|
inline |
Moves the current node to the current or the first sibling node after the current node that satisfies the specified conditions, and returns the current node. Node type is not important.
NodeName | If not null then the current node must have this name. |
NodeValue | If not null then the current node muust have this value. |
|
inline |
Moves the current node to the current or the first sibling node after the current node that satisfies the specified conditions, and returns the current node. Node type is not important.
NodeName | If not null then the current node must have this name. |
|
inline |
Moves the current node to the first sibling node after the current node that satisfies the specified conditions, and returns the current node.
NodeName | If not null then the current node must have this name. |
NodeValue | If not null then the current node muust have this value. |
|
inline |
Moves the current node to the first sibling node after the current node that satisfies the specified conditions, and returns the current node.
NodeName | If not null then the current node must have this name. |
|
inline |
Moves the current node to the first sibling element after the current node.
|
inline |
Moves the current node to the current or the first sibling node after the current node that satisfies the specified conditions, and returns the current node.
NodeName | If not null then the current node must have this name. |
NodeValue | If not null then the current node muust have this value. |
|
inline |
Moves the current node to the current or the first sibling node after the current node that satisfies the specified conditions, and returns the current node.
NodeName | If not null then the current node must have this name. |
|
inline |
Moves the current node to the current or the first sibling element after the current node.
|
private |
|
private |
|
private |
|
getset |
Xml document that represents the message.
|
getset |
The current node on which all queries are performed.
|
getset |
The node that was previously set to the current node.
|
getprivate set |
Parent of Current. If Current = null then Parent can still return something, which happens in particular when StepIn was performed before. Parent can be set to a specific node. That node will be returned by Parent when the Current is null (otherwise, the parent of Current is still returned). This is useful when current becomes null, e.g. because of running out of index bounds.
|
getprotected |
|
getprotected |
|
getprotected |
|
get |
Returns the name of the current node.
|
get |
Returns the value of the current node. If the current node is an element then the value of its first text child element is returned.
|
get |
Returns the inner text of the current node.