#include <IXMLNode.hpp>
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 |
The interface defines a node of an XML DOM tree
Defines the type of the XML node
| virtual Retval MQUALIFIER zeus::IXMLNode::appendNode | ( | IXMLNode & | rNewNode ) | [pure virtual] |
Adds a new node at the end of the child list
| rNewNode,: | child node to add |
| 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
| bRecurs,: | Flag if the node should be cloned in depth (with children) |
| rpNode,: | return parameter |
| 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.
| 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 |
| 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.
| eType,: | Node type |
| rstrName,: | Node name |
| rstrUri,: | Optinal URI |
| rpNode,: | return parameter |
| 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.
| rstrName,: | Name of the attribute |
| rstrValue,: | return parameter of the attribute value |
| 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.
| rstrName,: | Name of the attribute |
| rbValue,: | return parameter of the attribute value |
| 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.
| rstrName,: | Name of the attribute |
| rfValue,: | return parameter of the attribute value |
| 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.
| rstrName,: | Name of the attribute |
| riValue,: | return parameter of the attribute value |
| 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.
| rstrName,: | Name of the attribute |
| ruiValue,: | return parameter of the attribute value |
| 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
| rstrName,: | Name of the requested node |
| rpChildNode,: | Return parameter |
| 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
| 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
| rImpl,: | return parameter |
| 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.
| rstrName,: | Return parameter of the attribute name |
| rstrValue,: | Return parameter of the attribute value |
| 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.
| rpNode,: | return parameter |
| 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)
| rpNode,: | Return parameter |
| bOnlyElements,: | Flag if only node elements should be returned |
| 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
| rpList,: | return parameter |
| 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
| rstrName,: | return parameter |
| 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
| virtual Retval MQUALIFIER zeus::IXMLNode::getNodeValue | ( | IString & | rstrValue ) | const [pure virtual] |
returns the content of the node
| rstrValue,: | Return parameter of the content |
| 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
| rpParent,: | return parameter |
| 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.
| rstrText,: | return parameter |
| 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
| 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
| rNode,: | Node to insert |
| pBeforeNode,: | Right sibling of the insert position |
| 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.
| rstrName,: | Name of the node |
| 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
| 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.
| 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
| rstrQuery,: | XPath query |
| rpResult,: | Return parameter |
| 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
| rstrQuery,: | XPath to select the nodes |
| rpResults,: | Return parameter |
| 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
| rstrStream,: | return parameter of the stream |
| 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.
| rstrName,: | Name of the attribute |
| rstrValue,: | New value of the attribute |
| 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.
| 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
| rstrData,: | New node name |
| 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.
| rstrText,: | Text to set |
| RET_NOERROR,: | Text set |
| RET_REQUEST_FAILED,: | node is not an element |