ZeusBase-Library  2.0.4
zeus::IXMLNode Class Referenceabstract

#include <IXMLNode.hpp>

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

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, etXmlDecl = 14
}
 
enum  EImplementationType { etXerces = 1, etMSXML = 2, etXML2 = 3 }
 

Public Member Functions

virtual Retval MQUALIFIER appendNode (IXMLNode &rNewNode)=0
 
virtual Retval MQUALIFIER clone (bool bRecurs, IXMLNode *&rpNode) const =0
 
virtual Retval MQUALIFIER createElementChildNodeBySchema (const IString &rstrName, IXMLNode &rSchemaNode, IXMLNode *&rpNode, IXMLNode **ppRightSibling=NULL, bool bCheckMaxOccurs=true)=0
 
virtual Retval MQUALIFIER createNewChildNode (ENodeType eType, const IString &rstrName, const IString &rstrUri, IXMLNode *&rpNode)=0
 
virtual Retval MQUALIFIER getAttributeValue (const IString &rstrName, IString &rstrValue) 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 getAttributeValueInt (const IString &rstrName, Int &riValue) const =0
 
virtual Retval MQUALIFIER getAttributeValueUint (const IString &rstrName, Uint &ruiValue) const =0
 
virtual Retval MQUALIFIER getChildNode (const IString &rstrName, IXMLNode *&rpChildNode) const =0
 
virtual EImplementationType MQUALIFIER getImplClass () const =0
 
virtual Retval MQUALIFIER getImplPtr (INativePointer &rImpl) const =0
 
virtual Retval MQUALIFIER getNextAttribute (IString &rstrName, IString &rstrValue) const =0
 
virtual Retval MQUALIFIER getNextNode (IXMLNode *&rpNode) const =0
 
virtual Retval MQUALIFIER getNextSibling (IXMLNode *&rpNode, bool bOnlyElements=true) const =0
 
virtual Retval MQUALIFIER getNodeBaseName (IString &rstrName) const =0
 
virtual Retval MQUALIFIER getNodeList (IXMLNodeList *&rpList) const =0
 
virtual Retval MQUALIFIER getNodeName (IString &rstrName) const =0
 
virtual Retval MQUALIFIER getNodePrefix (IString &rstrName) const =0
 
virtual ENodeType MQUALIFIER getNodeType () const =0
 
virtual Retval MQUALIFIER getNodeValue (IString &rstrValue) const =0
 
virtual Retval MQUALIFIER getOwnerDocument (IXMLDocument *&rpDocument) const =0
 
virtual Retval MQUALIFIER getParentNode (IXMLNode *&rpParent) const =0
 
virtual Retval MQUALIFIER getText (IString &rstrText) const =0
 
virtual bool MQUALIFIER hasChildren () const =0
 
virtual Retval MQUALIFIER insertNode (IXMLNode &rNode, IXMLNode *pBeforeNode)=0
 
virtual Retval MQUALIFIER removeAttribute (const IString &rstrName)=0
 
virtual Retval MQUALIFIER removeMe ()=0
 
virtual void MQUALIFIER resetAttributeIterator () const =0
 
virtual void MQUALIFIER resetNodeIterator (const IString &rstrName) const =0
 
virtual Retval MQUALIFIER selectNode (const IString &rstrQuery, IXMLNode *&rpResult) const =0
 
virtual Retval MQUALIFIER selectNodes (const IString &rstrQuery, IXPathResults *&rpResults) const =0
 
virtual Retval MQUALIFIER serializeNode (IString &rstrStream) const =0
 
virtual Retval MQUALIFIER setAttributeValue (const IString &rstrName, const IString &rstrValue)=0
 
virtual void MQUALIFIER setImplPtr (INativePointer &rImpl)=0
 
virtual Retval MQUALIFIER setNodeValue (const IString &rstrData)=0
 
virtual Retval MQUALIFIER setOwnerDocument (IXMLDocument &rDocument)=0
 
virtual Retval MQUALIFIER setText (const IString &rstrText)=0
 
- Public Member Functions inherited from zeus::IZUnknown
virtual Retval MQUALIFIER askForInterface (const InterfaceID &rInterfaceID, IZUnknown *&rpIface)=0
 
virtual void MQUALIFIER addRef () const =0
 
virtual void MQUALIFIER release () const =0
 

Detailed Description

The interface defines a node of an XML DOM tree

Member Enumeration Documentation

§ EImplementationType

Describes the type of the XML implementation (API)

Enumerator
etXerces 

MSXML API

etMSXML 

Xerces API

etXML2 

XML 2 API

§ ENodeType

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

etXmlDecl 

Descripes a file as XML. Mostly this is placed at the top of the DOM before root node.

Member Function Documentation

§ appendNode()

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

Adds a new node at the end of the child list

Parameters
rNewNodechild node to add
Return values
RET_NOERRORNode added
RET_REQUEST_FAILEDCould not add as child node

§ clone()

virtual Retval MQUALIFIER zeus::IXMLNode::clone ( bool  bRecurs,
IXMLNode *&  rpNode 
) const
pure virtual

Clones the node and returns a new node

Parameters
bRecursFlag if the node should be cloned in depth (with children)
rpNodereturn parameter
Return values
RET_NOERRORNode cloned
RET_REQUEST_FAILEDCould not clone the node

§ createElementChildNodeBySchema()

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
rstrNameNode name
rSchemaNodeschema node to use
rpNodereturn parameter
ppRightSiblingOptinal return parameter to get the right sibling
bCheckMaxOccursFlag to check the maximum occurance of the child node
Return values
RET_NOERRORNode created and returned
RET_INVALID_PARAMETERschema node is invalid. Pass a valid XSDNode.
RET_INVALID_TYPEInvalid type definitions (not found)
RET_ABORTMaximum occurance reached
RET_REQUEST_FAILEDCould not create the node. Check name and URI

§ createNewChildNode()

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
eTypeNode type
rstrNameNode name
rstrUriOptinal URI
rpNodereturn parameter
Return values
RET_NOERRORNode created and returned
RET_REQUEST_FAILEDCould not create the node. Check name and URI

§ getAttributeValue()

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
rstrNameName of the attribute
rstrValuereturn parameter of the attribute value
Return values
RET_NOERRORattribute found and returned
RET_REQUEST_FAILEDNo such attribute found

§ getAttributeValueBool()

virtual Retval MQUALIFIER zeus::IXMLNode::getAttributeValueBool ( const IString rstrName,
bool &  rbValue 
) const
pure virtual

Reads a bool attribute from an xml node element.

Parameters
rstrNameName of the attribute
rbValuereturn parameter of the attribute value
Return values
RET_NOERRORattribute found and returned
RET_REQUEST_FAILEDNo such attribute found

§ getAttributeValueFloat()

virtual Retval MQUALIFIER zeus::IXMLNode::getAttributeValueFloat ( const IString rstrName,
Float &  rfValue 
) const
pure virtual

Reads a float attribute from an xml node element.

Parameters
rstrNameName of the attribute
rfValuereturn parameter of the attribute value
Return values
RET_NOERRORattribute found and returned
RET_REQUEST_FAILEDNo such attribute found

§ getAttributeValueInt()

virtual Retval MQUALIFIER zeus::IXMLNode::getAttributeValueInt ( const IString rstrName,
Int &  riValue 
) const
pure virtual

Reads an integer attribute from an xml node element.

Parameters
rstrNameName of the attribute
riValuereturn parameter of the attribute value
Return values
RET_NOERRORattribute found and returned
RET_REQUEST_FAILEDNo such attribute found

§ getAttributeValueUint()

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
rstrNameName of the attribute
ruiValuereturn parameter of the attribute value
Return values
RET_NOERRORattribute found and returned
RET_REQUEST_FAILEDNo such attribute found

§ getChildNode()

virtual Retval MQUALIFIER zeus::IXMLNode::getChildNode ( const IString rstrName,
IXMLNode *&  rpChildNode 
) const
pure virtual

Searches the first node having the given name

Parameters
rstrNameName of the requested node
rpChildNodeReturn parameter
Return values
RET_NOERRORNode found and returned
RET_REQUEST_FAILEDNo such node found

§ getImplClass()

virtual EImplementationType MQUALIFIER zeus::IXMLNode::getImplClass ( ) const
pure virtual

Returns the type of the XML API

Returns
API type

§ getImplPtr()

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
rImplreturn parameter
Return values
RET_NOERRORAPI pointer returned
RET_REQUEST_FAILEDno API pointer found

§ getNextAttribute()

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
rstrNameReturn parameter of the attribute name
rstrValueReturn parameter of the attribute value
Return values
RET_NOERRORAttribute found and returned
RET_REQUEST_FAILEDNo attribute found

§ getNextNode()

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
rpNodereturn parameter
Return values
RET_NOERRORa next child found and returned
RET_REQUEST_FAILEDend of child node list reached

§ getNextSibling()

virtual Retval MQUALIFIER zeus::IXMLNode::getNextSibling ( IXMLNode *&  rpNode,
bool  bOnlyElements = true 
) const
pure virtual

Returns the next sibling of this node (right side)

Parameters
rpNodeReturn parameter
bOnlyElementsFlag if only node elements should be returned
Return values
RET_NOERRORNext sibling returned
RET_REQUEST_FAILEDNo next sibling found

§ getNodeBaseName()

virtual Retval MQUALIFIER zeus::IXMLNode::getNodeBaseName ( IString rstrName) const
pure virtual

Returns the base name of the node

Parameters
rstrNamereturn parameter
Return values
RET_NOERRORbase name returned
RET_INTERNAL_ERRORNo valid node from API

§ getNodeList()

virtual Retval MQUALIFIER zeus::IXMLNode::getNodeList ( IXMLNodeList *&  rpList) const
pure virtual

returns all sub nodes of an xml node

Parameters
rpListreturn parameter
Return values
RET_NOERRORList returned
RET_REQUEST_FAILEDCould not return the sub nodes

§ getNodeName()

virtual Retval MQUALIFIER zeus::IXMLNode::getNodeName ( IString rstrName) const
pure virtual

Returns the name of the node

Parameters
rstrNamereturn parameter
Return values
RET_NOERRORname returned
RET_INTERNAL_ERRORNo valid node from API

§ getNodePrefix()

virtual Retval MQUALIFIER zeus::IXMLNode::getNodePrefix ( IString rstrName) const
pure virtual

Returns the prefix of the node

Parameters
rstrNamereturn parameter
Return values
RET_NOERRORprefix returned
RET_INTERNAL_ERRORNo valid node from API

§ getNodeType()

virtual ENodeType MQUALIFIER zeus::IXMLNode::getNodeType ( ) const
pure virtual

Returns the type of the node

Returns
Type of node (see ENodeType)

§ getNodeValue()

virtual Retval MQUALIFIER zeus::IXMLNode::getNodeValue ( IString rstrValue) const
pure virtual

returns the content of the node

Parameters
rstrValueReturn parameter of the content
Return values
RET_NOERRORContent returned
RET_REQUEST_FAILEDCould not read any content

§ getOwnerDocument()

virtual Retval MQUALIFIER zeus::IXMLNode::getOwnerDocument ( IXMLDocument *&  rpDocument) const
pure virtual

returns the owner document of the XML node. This method is nowadays only internally used and not supported by all XML platforms

Parameters
rpDocumentReturn parameter of document instance
Return values
RET_NOERRORInstance returned
RET_REQUEST_FAILEDCould not return the instance (=NULL)
RET_METHOD_NOT_IMPLMethod for current XML platform not supported

§ getParentNode()

virtual Retval MQUALIFIER zeus::IXMLNode::getParentNode ( IXMLNode *&  rpParent) const
pure virtual

Returns the parent of the node

Parameters
rpParentreturn parameter
Return values
RET_NOERRORParent found and returned
RET_REQUEST_FAILEDNo parent found

§ getText()

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
rstrTextreturn parameter
Return values
RET_NOERRORtext returned
RET_REQUEST_FAILEDnode is not an element

§ hasChildren()

virtual bool MQUALIFIER zeus::IXMLNode::hasChildren ( ) const
pure virtual

Checks if the node has child nodes

Return values
trueNode has child elements
falseNode has no child elements

§ insertNode()

virtual Retval MQUALIFIER zeus::IXMLNode::insertNode ( IXMLNode rNode,
IXMLNode pBeforeNode 
)
pure virtual

Inserts a node into the child node list

Parameters
rNodeNode to insert
pBeforeNodeRight sibling of the insert position
Return values
RET_NOERRORNode inserted
RET_REQUEST_FAILEDCould not insert the node

§ removeAttribute()

virtual Retval MQUALIFIER zeus::IXMLNode::removeAttribute ( const IString rstrName)
pure virtual

This method removes an attribute from this node.

Parameters
rstrNameName of the node
Return values
RET_NOERRORAttribute removed
RET_REQUEST_FAILEDCould not find such an attribute

§ removeMe()

virtual Retval MQUALIFIER zeus::IXMLNode::removeMe ( )
pure virtual

Removes this node from the parent

Return values
RET_NOERRORNode has been removed
RET_REQUEST_FAILEDCould not remove node

§ resetAttributeIterator()

virtual void MQUALIFIER zeus::IXMLNode::resetAttributeIterator ( ) const
pure virtual

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

§ resetNodeIterator()

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
rstrNameOptional name of requested child nodes

§ selectNode()

virtual Retval MQUALIFIER zeus::IXMLNode::selectNode ( const IString rstrQuery,
IXMLNode *&  rpResult 
) const
pure virtual

Selects only one node using a XPath query

Parameters
rstrQueryXPath query
rpResultReturn parameter
Return values
RET_NOERRORNode selected and returned
RET_REQUEST_FAILEDNo node found

§ selectNodes()

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
rstrQueryXPath to select the nodes
rpResultsReturn parameter
Return values
RET_NOERRORNodes found and returned
RET_REQUEST_FAILEDNo such nodes found

§ serializeNode()

virtual Retval MQUALIFIER zeus::IXMLNode::serializeNode ( IString rstrStream) const
pure virtual

Serializes the XML node into a string stream

Parameters
rstrStreamreturn parameter of the stream
Return values
RET_NOERRORSerializing was successful
RET_REQUEST_FAILEDFailed to serialize the node

§ setAttributeValue()

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
rstrNameName of the attribute
rstrValueNew value of the attribute
Return values
RET_NOERRORAttribute value set
RET_REQUEST_FAILEDCould not set an attribute value

§ setImplPtr()

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
rImplNew API pointer

§ setNodeValue()

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
rstrDataNew node name
Return values
RET_NOERRORName changed
RET_REQUEST_FAILEDCould not change the name

§ setOwnerDocument()

virtual Retval MQUALIFIER zeus::IXMLNode::setOwnerDocument ( IXMLDocument rDocument)
pure virtual

sets a new owner document to the XML node. This method is nowadays only internally used and not supported by all XML platforms

Parameters
rDocumentReturn parameter of document instance
Return values
RET_NOERRORInstance set
RET_METHOD_NOT_IMPLMethod for current XML platform not supported

§ setText()

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
rstrTextText to set
Return values
RET_NOERRORText set
RET_REQUEST_FAILEDnode is not an element

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


Written by Benjamin Hadorn http://www.xatlantis.ch.
Last change made on Tue Sep 13 2016 22:31:42