IGLib 1.4
The IGLib base library for development of numerical, technical and business applications.

IG::Lib::XmlUtilityBase Class Reference

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

Inheritance diagram for IG::Lib::XmlUtilityBase:

List of all members.

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.
static string GetDefaultNameSpaceUri (XmlDocument doc)
 Gets the default namespace URI of teh Xml document.
static string GetDefaultNameSpaceUri (XmlNode node)
 Returns the default namespace URI that applies to the specified Xml node.
static string GetNameSpaceUri (XmlDocument doc, string prefix)
 Returns the namespace URI associated with a specific prefix that applies to the specified Xml document.
static string GetNameSpaceUri (XmlNode node, string prefix)
 Returns the namespace URI associated with a specific prefix that applies to the specified Xml document.

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

Properties

virtual IG.Lib.IReporter R [get]
 Reporter for this class.
virtual bool HasDefaultNameSpace [get, set]
string FileName [get, set]
virtual XmlDocument Doc [get, set]
 Xml document that represents the message.
XmlNode Root [get, set]
 Root node of the current document.

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

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) [inline, static]

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

Parameters:
element
static string IG::Lib::XmlUtilityBase::GetDefaultNameSpaceUri ( XmlDocument  doc) [inline, static]

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) [inline, static]

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) [inline, static, private]
static string IG::Lib::XmlUtilityBase::GetNameSpaceUri0 ( XmlElement  element,
string  NamespaceAttributeName 
) [inline, static, private]

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 
) [inline, static, private]

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 
) [inline, static]

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

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

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

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

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 
) [inline, protected]

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

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 [get, set]
string IG::Lib::XmlUtilityBase::FileName [get, set]
virtual XmlDocument IG::Lib::XmlUtilityBase::Doc [get, set]

Xml document that represents the message.

Reimplemented in IG::Lib::XmlParser.

XmlNode IG::Lib::XmlUtilityBase::Root [get, set]

Root node of the current document.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties Events