Public Types | Public Member Functions

zeus::IXMLNode Class Reference

#include <IXMLNode.hpp>

Inheritance diagram for zeus::IXMLNode:
zeus::IZUnknown zeus::IXSDNode

List of all members.

Public Types

enum  ENodeType {
  etCDataSection = 1, etComment = 2, etDocument = 3, etDocumentFragment = 4,
  etText = 5, etDocumentType = 6, etElement = 7, etEntity = 8,
  etEntityReference = 9, etNotation = 10, etProcessingInstruction = 11, etAttribute = 12,
  etNodeDecl = 13
}
enum  EImplementationType { etXerces = 1, etMSXML = 2 }

Public Member Functions

virtual Retval MQUALIFIER getNodeName (IString &rstrName) const =0
virtual ENodeType MQUALIFIER getNodeType () const =0
virtual Retval MQUALIFIER getNodeValue (IString &rstrValue) const =0
virtual Retval MQUALIFIER getAttributeValue (const IString &rstrName, IString &rstrValue) const =0
virtual Retval MQUALIFIER getAttributeValueInt (const IString &rstrName, Int &riValue) const =0
virtual Retval MQUALIFIER getAttributeValueUint (const IString &rstrName, Uint &ruiValue) const =0
virtual Retval MQUALIFIER getAttributeValueBool (const IString &rstrName, bool &rbValue) const =0
virtual Retval MQUALIFIER getAttributeValueFloat (const IString &rstrName, Float &rfValue) const =0
virtual Retval MQUALIFIER getNodeList (IXMLNodeList *&rpList) const =0
virtual void MQUALIFIER resetNodeIterator (const IString &rstrName) const =0
virtual Retval MQUALIFIER getNextNode (IXMLNode *&rpNode) const =0
virtual bool MQUALIFIER hasChildren () const =0
virtual Retval MQUALIFIER appendNode (IXMLNode &rNewNode)=0
virtual Retval MQUALIFIER createNewChildNode (ENodeType eType, const IString &rstrName, const IString &rstrUri, IXMLNode *&rpNode)=0
virtual Retval MQUALIFIER createElementChildNodeBySchema (const IString &rstrName, IXMLNode &rSchemaNode, IXMLNode *&rpNode, IXMLNode **ppRightSibling=NULL, bool bCheckMaxOccurs=true)=0
virtual Retval MQUALIFIER setNodeValue (const IString &rstrData)=0
virtual Retval MQUALIFIER setAttributeValue (const IString &rstrName, const IString &rstrValue)=0
virtual Retval MQUALIFIER removeMe ()=0
virtual EImplementationType
MQUALIFIER 
getImplClass () const =0
virtual void MQUALIFIER resetAttributeIterator () const =0
virtual Retval MQUALIFIER getNextAttribute (IString &rstrName, IString &rstrValue) const =0
virtual Retval MQUALIFIER getParentNode (IXMLNode *&rpParent) const =0
virtual Retval MQUALIFIER getNextSibling (IXMLNode *&rpNode, bool bOnlyElements=true) const =0
virtual Retval MQUALIFIER selectNodes (const IString &rstrQuery, IXPathResults *&rpResults) const =0
virtual Retval MQUALIFIER clone (bool bRecurs, IXMLNode *&rpNode) const =0
virtual Retval MQUALIFIER insertNode (IXMLNode &rNode, IXMLNode *pBeforeNode)=0
virtual Retval MQUALIFIER serializeNode (IString &rstrStream) const =0
virtual Retval MQUALIFIER getImplPtr (INativePointer &rImpl) const =0
virtual void MQUALIFIER setImplPtr (INativePointer &rImpl)=0
virtual Retval MQUALIFIER selectNode (const IString &rstrQuery, IXMLNode *&rpResult) const =0
virtual Retval MQUALIFIER getChildNode (const IString &rstrName, IXMLNode *&rpChildNode) const =0
virtual Retval MQUALIFIER removeAttribute (const IString &rstrName)=0
virtual Retval MQUALIFIER getText (IString &rstrText) const =0
virtual Retval MQUALIFIER setText (const IString &rstrText)=0

Detailed Description

The interface defines a node of an XML DOM tree


Member Enumeration Documentation

Describes the type of the XML implementation (API)

Enumerator:
etXerces 

MSXML API

etMSXML 

Xerces API

Defines the type of the XML node

Enumerator:
etCDataSection 

Describes a CDATA section

etComment 

Describes a comment

etDocument 

Describes a XML document node

etDocumentFragment 

Describes a fragment of the document

etText 

Describes a text node

etDocumentType 

Describes a document type node

etElement 

Describes a regular XML element

etEntity 

Describes an entity

etEntityReference 

Describes an entity reference

etNotation 

Describes a notation

etProcessingInstruction 

Describes a processing instruction

etAttribute 

Describes an XML attribute

etNodeDecl 

Describes a node declaration


Member Function Documentation

virtual Retval MQUALIFIER zeus::IXMLNode::appendNode ( IXMLNode rNewNode ) [pure virtual]

Adds a new node at the end of the child list

Parameters:
rNewNode,:child node to add
Return values:
RET_NOERROR,:Node added
RET_REQUEST_FAILED,:Could not add as child node
virtual Retval MQUALIFIER zeus::IXMLNode::clone ( bool  bRecurs,
IXMLNode *&  rpNode 
) const [pure virtual]

Clones the node and returns a new node

Parameters:
bRecurs,:Flag if the node should be cloned in depth (with children)
rpNode,:return parameter
Return values:
RET_NOERROR,:Node cloned
RET_REQUEST_FAILED,:Could not clone the node
virtual Retval MQUALIFIER zeus::IXMLNode::createElementChildNodeBySchema ( const IString rstrName,
IXMLNode rSchemaNode,
IXMLNode *&  rpNode,
IXMLNode **  ppRightSibling = NULL,
bool  bCheckMaxOccurs = true 
) [pure virtual]

This method creates a new child node and adds it as child node to this node. The node is created using a schema specification.

Parameters:
rstrName,:Node name
rSchemaNode,:schema node to use
rpNode,:return parameter
ppRightSibling,:Optinal return parameter to get the right sibling
bCheckMaxOccurs,:Flag to check the maximum occurance of the child node
Return values:
RET_NOERROR,:Node created and returned
RET_INVALID_PARAMETER,:schema node is invalid. Pass a valid XSDNode.
RET_INVALID_TYPE,:Invalid type definitions (not found)
RET_ABORT,:Maximum occurance reached
RET_REQUEST_FAILED,:Could not create the node. Check name and URI
virtual Retval MQUALIFIER zeus::IXMLNode::createNewChildNode ( ENodeType  eType,
const IString rstrName,
const IString rstrUri,
IXMLNode *&  rpNode 
) [pure virtual]

This method creates a new child node and adds it as child node to this node.

Parameters:
eType,:Node type
rstrName,:Node name
rstrUri,:Optinal URI
rpNode,:return parameter
Return values:
RET_NOERROR,:Node created and returned
RET_REQUEST_FAILED,:Could not create the node. Check name and URI
virtual Retval MQUALIFIER zeus::IXMLNode::getAttributeValue ( const IString rstrName,
IString rstrValue 
) const [pure virtual]

Reads an attribute from a xml node element. Use this method for etElement types only.

Parameters:
rstrName,:Name of the attribute
rstrValue,:return parameter of the attribute value
Return values:
RET_NOERROR,:attribute found and returned
RET_REQUEST_FAILED,:No such attribute found
virtual Retval MQUALIFIER zeus::IXMLNode::getAttributeValueBool ( const IString rstrName,
bool &  rbValue 
) const [pure virtual]

Reads a bool attribute from an xml node element.

Parameters:
rstrName,:Name of the attribute
rbValue,:return parameter of the attribute value
Return values:
RET_NOERROR,:attribute found and returned
RET_REQUEST_FAILED,:No such attribute found
virtual Retval MQUALIFIER zeus::IXMLNode::getAttributeValueFloat ( const IString rstrName,
Float &  rfValue 
) const [pure virtual]

Reads a float attribute from an xml node element.

Parameters:
rstrName,:Name of the attribute
rfValue,:return parameter of the attribute value
Return values:
RET_NOERROR,:attribute found and returned
RET_REQUEST_FAILED,:No such attribute found
virtual Retval MQUALIFIER zeus::IXMLNode::getAttributeValueInt ( const IString rstrName,
Int &  riValue 
) const [pure virtual]

Reads an integer attribute from an xml node element.

Parameters:
rstrName,:Name of the attribute
riValue,:return parameter of the attribute value
Return values:
RET_NOERROR,:attribute found and returned
RET_REQUEST_FAILED,:No such attribute found
virtual Retval MQUALIFIER zeus::IXMLNode::getAttributeValueUint ( const IString rstrName,
Uint &  ruiValue 
) const [pure virtual]

Reads an unsigned integer attribute from an xml node element.

Parameters:
rstrName,:Name of the attribute
ruiValue,:return parameter of the attribute value
Return values:
RET_NOERROR,:attribute found and returned
RET_REQUEST_FAILED,:No such attribute found
virtual Retval MQUALIFIER zeus::IXMLNode::getChildNode ( const IString rstrName,
IXMLNode *&  rpChildNode 
) const [pure virtual]

Searches the first node having the given name

Parameters:
rstrName,:Name of the requested node
rpChildNode,:Return parameter
Return values:
RET_NOERROR,:Node found and returned
RET_REQUEST_FAILED,:No such node found
virtual EImplementationType MQUALIFIER zeus::IXMLNode::getImplClass (  ) const [pure virtual]

Returns the type of the XML API

Returns:
API type
virtual Retval MQUALIFIER zeus::IXMLNode::getImplPtr ( INativePointer rImpl ) const [pure virtual]

This method returns the implementation pointer of a concrete xml node. Do not use this method outside of the XML_Service module

Parameters:
rImpl,:return parameter
Return values:
RET_NOERROR,:API pointer returned
RET_REQUEST_FAILED,:no API pointer found
virtual Retval MQUALIFIER zeus::IXMLNode::getNextAttribute ( IString rstrName,
IString rstrValue 
) const [pure virtual]

Returns the next attribute of the iterator. Call first resetAttributeIterator() first.

Parameters:
rstrName,:Return parameter of the attribute name
rstrValue,:Return parameter of the attribute value
Return values:
RET_NOERROR,:Attribute found and returned
RET_REQUEST_FAILED,:No attribute found
virtual Retval MQUALIFIER zeus::IXMLNode::getNextNode ( IXMLNode *&  rpNode ) const [pure virtual]

Returns the next child node. Call first resetNodeIterator() before calling this method. This method will automatically iterate to the next after calling it.

Parameters:
rpNode,:return parameter
Return values:
RET_NOERROR,:a next child found and returned
RET_REQUEST_FAILED,:end of child node list reached
virtual Retval MQUALIFIER zeus::IXMLNode::getNextSibling ( IXMLNode *&  rpNode,
bool  bOnlyElements = true 
) const [pure virtual]

Returns the next sibling of this node (right side)

Parameters:
rpNode,:Return parameter
bOnlyElements,:Flag if only node elements should be returned
Return values:
RET_NOERROR,:Next sibling returned
RET_REQUEST_FAILED,:No next sibling found
virtual Retval MQUALIFIER zeus::IXMLNode::getNodeList ( IXMLNodeList *&  rpList ) const [pure virtual]

returns all sub nodes of an xml node

Parameters:
rpList,:return parameter
Return values:
RET_NOERROR,:List returned
RET_REQUEST_FAILED,:Could not return the sub nodes
virtual Retval MQUALIFIER zeus::IXMLNode::getNodeName ( IString rstrName ) const [pure virtual]

Returns the name of the node

Parameters:
rstrName,:return parameter
Return values:
RET_NOERROR,:name returned
RET_INTERNAL_ERROR,:No valid node from API
virtual ENodeType MQUALIFIER zeus::IXMLNode::getNodeType (  ) const [pure virtual]

Returns the type of the node

Returns:
Type of node (see ENodeType)
virtual Retval MQUALIFIER zeus::IXMLNode::getNodeValue ( IString rstrValue ) const [pure virtual]

returns the content of the node

Parameters:
rstrValue,:Return parameter of the content
Return values:
RET_NOERROR,:Content returned
RET_REQUEST_FAILED,:Could not read any content
virtual Retval MQUALIFIER zeus::IXMLNode::getParentNode ( IXMLNode *&  rpParent ) const [pure virtual]

Returns the parent of the node

Parameters:
rpParent,:return parameter
Return values:
RET_NOERROR,:Parent found and returned
RET_REQUEST_FAILED,:No parent found
virtual Retval MQUALIFIER zeus::IXMLNode::getText ( IString rstrText ) const [pure virtual]

returns the text child node. If the node is not an element this method will fail.

Parameters:
rstrText,:return parameter
Return values:
RET_NOERROR,:text returned
RET_REQUEST_FAILED,:node is not an element
virtual bool MQUALIFIER zeus::IXMLNode::hasChildren (  ) const [pure virtual]

Checks if the node has child nodes

Return values:
true,:Node has child elements
false,:Node has no child elements
virtual Retval MQUALIFIER zeus::IXMLNode::insertNode ( IXMLNode rNode,
IXMLNode pBeforeNode 
) [pure virtual]

Inserts a node into the child node list

Parameters:
rNode,:Node to insert
pBeforeNode,:Right sibling of the insert position
Return values:
RET_NOERROR,:Node inserted
RET_REQUEST_FAILED,:Could not insert the node
virtual Retval MQUALIFIER zeus::IXMLNode::removeAttribute ( const IString rstrName ) [pure virtual]

This method removes an attribute from this node.

Parameters:
rstrName,:Name of the node
Return values:
RET_NOERROR,:Attribute removed
RET_REQUEST_FAILED,:Could not find such an attribute
virtual Retval MQUALIFIER zeus::IXMLNode::removeMe (  ) [pure virtual]

Removes this node from the parent

Return values:
RET_NOERROR,:Node has been removed
RET_REQUEST_FAILED,:Could not remove node
virtual void MQUALIFIER zeus::IXMLNode::resetAttributeIterator (  ) const [pure virtual]

Resets the attribute iterator. The iterator must be reset before calling getNextAttribute().

virtual void MQUALIFIER zeus::IXMLNode::resetNodeIterator ( const IString rstrName ) const [pure virtual]

Resets the node iterator. Optional a node name can be passed. This will return only child nodes with that given name. If the name is empty or NULL, getNextNode() will return all nodes starting with the first child.

Parameters:
rstrName,:Optional name of requested child nodes
virtual Retval MQUALIFIER zeus::IXMLNode::selectNode ( const IString rstrQuery,
IXMLNode *&  rpResult 
) const [pure virtual]

Selects only one node using a XPath query

Parameters:
rstrQuery,:XPath query
rpResult,:Return parameter
Return values:
RET_NOERROR,:Node selected and returned
RET_REQUEST_FAILED,:No node found
virtual Retval MQUALIFIER zeus::IXMLNode::selectNodes ( const IString rstrQuery,
IXPathResults *&  rpResults 
) const [pure virtual]

Returns a collection of XML nodes by selecting them using an XPath

Parameters:
rstrQuery,:XPath to select the nodes
rpResults,:Return parameter
Return values:
RET_NOERROR,:Nodes found and returned
RET_REQUEST_FAILED,:No such nodes found
virtual Retval MQUALIFIER zeus::IXMLNode::serializeNode ( IString rstrStream ) const [pure virtual]

Serializes the XML node into a string stream

Parameters:
rstrStream,:return parameter of the stream
Return values:
RET_NOERROR,:Serializing was successful
RET_REQUEST_FAILED,:Failed to serialize the node
virtual Retval MQUALIFIER zeus::IXMLNode::setAttributeValue ( const IString rstrName,
const IString rstrValue 
) [pure virtual]

Sets a new attribute value to an attribute. If the attribute does not yet exist, it will created.

Parameters:
rstrName,:Name of the attribute
rstrValue,:New value of the attribute
Return values:
RET_NOERROR,:Attribute value set
RET_REQUEST_FAILED,:Could not set an attribute value
virtual void MQUALIFIER zeus::IXMLNode::setImplPtr ( INativePointer rImpl ) [pure virtual]

This method sets the implementation pointer of a concrete xml node. Do not use this method outside of the XML_Service module.

Parameters:
rImpl,:New API pointer
virtual Retval MQUALIFIER zeus::IXMLNode::setNodeValue ( const IString rstrData ) [pure virtual]

Sets the node value. Not for all node types the name can be changed

Parameters:
rstrData,:New node name
Return values:
RET_NOERROR,:Name changed
RET_REQUEST_FAILED,:Could not change the name
virtual Retval MQUALIFIER zeus::IXMLNode::setText ( const IString rstrText ) [pure virtual]

sets the text child node. If the node is not an element this method will fail. If there exists a text node already, this will simply overwrite its content.

Parameters:
rstrText,:Text to set
Return values:
RET_NOERROR,:Text set
RET_REQUEST_FAILED,:node is not an element

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


Written by Benjamin Hadorn http://www.xatlantis.ch.
Last change made on Sun Jan 22 2012 15:28:37