IGLib  1.7.2
The IGLib base library for development of numerical, technical and business applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
IG.Lib.XmlUtilityBase Class Reference

Base class for various utilities operating on XmlDocumnt. More...

+ Inheritance diagram for IG.Lib.XmlUtilityBase:

Public Member Functions

virtual void SetDocument (XmlDataDocument doc)
 
virtual void Load (string filename)
 
virtual void LoadXml (string docstr)
 

Static Public Member Functions

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...
 

Public Attributes

string DefaultNameSpace = null
 
string DefaultNameSpacePrefix = "defaultnsprefix"
 

Protected Member Functions

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

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...
 

Static Private Member Functions

static string GetNamespaceAttributeName (string prefix)
 
static string GetNameSpaceUri0 (XmlElement element, string NamespaceAttributeName)
 Gets the namespace URI introduced by a particular attribute, if defined, for the specified Xml element. More...
 
static string GetNameSpaceUri (XmlElement element, string prefix)
 Returns the namespace URI associated with a specific prefix that applies to the specified Xml element. URI information is obtained from the corresponding attribute of the specified node and eventually its parent _gridCoordinates. More...
 

Private Attributes

bool _hasDefaultNameSpace = false
 
const string XmlNsAttribute = "xmlns"
 
string _filename = null
 
XmlDocument _doc = null
 
XmlNode _root = null
 

Detailed Description

Base class for various utilities operating on XmlDocumnt.

Member Function Documentation

static string IG.Lib.XmlUtilityBase.GetDefaultNameSpaceUri ( XmlElement  element)
inlinestatic

Gets the default namespace URI if defined, for the specified Xml element.

Parameters
element
static string IG.Lib.XmlUtilityBase.GetDefaultNameSpaceUri ( XmlDocument  doc)
inlinestatic

Gets the default namespace URI of teh Xml document.

Parameters
docXml document to which the default namespace might apply.
Returns
Tha default namespace URI that applies to the document, or null if there is no such namespace.
static string IG.Lib.XmlUtilityBase.GetDefaultNameSpaceUri ( XmlNode  node)
inlinestatic

Returns the default namespace URI that applies to the specified Xml node.

Parameters
nodeXml node to which namespace URI applies.
Returns
The defaulut namespace URI atht applies to the node, or null if there is no default namespace.
static string IG.Lib.XmlUtilityBase.GetNamespaceAttributeName ( string  prefix)
inlinestaticprivate
static string IG.Lib.XmlUtilityBase.GetNameSpaceUri0 ( XmlElement  element,
string  NamespaceAttributeName 
)
inlinestaticprivate

Gets the namespace URI introduced by a particular attribute, if defined, for the specified Xml element.

Parameters
elementElement for which rhe specific namespace URI is searched for.
NamespaceAttributeNameAttribute name that introduces that namespace.
static string IG.Lib.XmlUtilityBase.GetNameSpaceUri ( XmlElement  element,
string  prefix 
)
inlinestaticprivate

Returns the namespace URI associated with a specific prefix that applies to the specified Xml element. URI information is obtained from the corresponding attribute of the specified node and eventually its parent _gridCoordinates.

Parameters
elementElement for which namespace URI is searched for.
prefixPrefix for which teh namespace is searched for. If null or empty string then a default namespace URI is searched for.
Returns
The namespace URI corresponding to the specified prefix at the level of a specified element, or null if the particular namespace URI is not defined.
static string IG.Lib.XmlUtilityBase.GetNameSpaceUri ( XmlDocument  doc,
string  prefix 
)
inlinestatic

Returns the namespace URI associated with a specific prefix that applies to the specified Xml document.

Parameters
docXml document to which namespace URI applies.
prefixPrefix.
Returns
The namespace URI if found, null otherwise.
static string IG.Lib.XmlUtilityBase.GetNameSpaceUri ( XmlNode  node,
string  prefix 
)
inlinestatic

Returns the namespace URI associated with a specific prefix that applies to the specified Xml document.

Parameters
nodeXml node to which namespace URI applies.
prefixPrefix.
Returns
The namespace URI if found, null otherwise.
virtual void IG.Lib.XmlUtilityBase.SetDocument ( XmlDataDocument  doc)
inlinevirtual
virtual void IG.Lib.XmlUtilityBase.Load ( string  filename)
inlinevirtual
virtual void IG.Lib.XmlUtilityBase.LoadXml ( string  docstr)
inlinevirtual
bool IG.Lib.XmlUtilityBase.ContainedInDocument ( XmlNode  node,
XmlDocument  doc 
)
inlineprotected

Returns true if an Xml node is contained in the specified Xml document (false if any is null).

bool IG.Lib.XmlUtilityBase.ContainedInNode ( XmlNode  node,
XmlNode  container 
)
inlineprotected

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.

Parameters
nodeNode that might be contained in another node.
containerThe node that might contain another node.
Returns
true if container contains node, false othwrwise.

Member Data Documentation

bool IG.Lib.XmlUtilityBase._hasDefaultNameSpace = false
private
string IG.Lib.XmlUtilityBase.DefaultNameSpace = null
string IG.Lib.XmlUtilityBase.DefaultNameSpacePrefix = "defaultnsprefix"
const string IG.Lib.XmlUtilityBase.XmlNsAttribute = "xmlns"
private
string IG.Lib.XmlUtilityBase._filename = null
private
XmlDocument IG.Lib.XmlUtilityBase._doc = null
private
XmlNode IG.Lib.XmlUtilityBase._root = null
private

Property Documentation

virtual IG.Lib.IReporter IG.Lib.XmlUtilityBase.R
get

Reporter for this class.

virtual bool IG.Lib.XmlUtilityBase.HasDefaultNameSpace
getprotected set
string IG.Lib.XmlUtilityBase.FileName
getprotected set
virtual XmlDocument IG.Lib.XmlUtilityBase.Doc
getset

Xml document that represents the message.

XmlNode IG.Lib.XmlUtilityBase.Root
getprivate set

Root node of the current document.


The documentation for this class was generated from the following file: