TXmlEngNode Class Reference

#include <xml/dom/xmlengnode.h>

Link against: xmlenginedom.lib

class TXmlEngNode
Protected Attributes
void *iInternal
Public Member Enumerations
enumTXmlEngDOMNodeType { EElement, EAttribute, EText, ECDATASection, ..., EFileContainer }
Public Member Functions
TXmlEngNode()
TXmlEngNode(void *)
IMPORT_C TBoolAddUserData(MXmlEngUserData *)
IMPORT_C TXmlEngNodeAppendChildL(TXmlEngNode)
TXmlEngAttr &AsAttr()
TXmlEngBinaryContainer &AsBinaryContainer()
TXmlEngCDATASection &AsCDATASection()
TXmlEngChunkContainer &AsChunkContainer()
TXmlEngComment &AsComment()
TXmlEngDataContainer &AsDataContainer()
TXmlEngDocumentFragment &AsDocumentFragment()
TXmlEngElement &AsElement()
TXmlEngEntityReference &AsEntityReference()
TXmlEngFileContainer &AsFileContainer()
TXmlEngNamespace &AsNamespace()
TXmlEngProcessingInstruction &AsProcessingInstruction()
TXmlEngTextNode &AsText()
IMPORT_C voidBaseUriL(RBuf8 &)
IMPORT_C TXmlEngNodeCopyL()
IMPORT_C TXmlEngNodeCopyToL(TXmlEngNode)
IMPORT_C TXmlEngNodeFirstChild()
IMPORT_C voidGetChildNodes(RXmlEngNodeList< TXmlEngNode > &)
IMPORT_C TBoolHasAttributes()
IMPORT_C TBoolHasChildNodes()
IMPORT_C TIntInnerXmlL(RBuf8 &)
IMPORT_C TBoolIsDefaultNamespaceL(const TDesC8 &)
TBool IsNull()
TBool IsSameNode(TXmlEngNode)
IMPORT_C TBoolIsSimpleTextContents()
IMPORT_C TXmlEngNodeLastChild()
IMPORT_C TPtrC8LookupNamespaceUriL(const TDesC8 &)
IMPORT_C TPtrC8LookupPrefixL(const TDesC8 &)
IMPORT_C voidMoveAfterSibling(TXmlEngNode)
IMPORT_C voidMoveBeforeSibling(TXmlEngNode)
TXmlEngNode MoveTo(TXmlEngNode)
TXmlEngNode MoveToL(TXmlEngNode)
IMPORT_C TPtrC8Name()
IMPORT_C TXmlEngNamespaceNamespaceDeclaration()
IMPORT_C TPtrC8NamespaceUri()
IMPORT_C TXmlEngNodeNextSibling()
IMPORT_C TXmlEngDOMNodeTypeNodeType()
TBool NotNull()
IMPORT_C TIntOuterXmlL(RBuf8 &)
IMPORT_C RXmlEngDocumentOwnerDocument()
IMPORT_C TXmlEngNodeParentNode()
IMPORT_C TPtrC8Prefix()
IMPORT_C TXmlEngNodePreviousSibling()
IMPORT_C voidReconcileNamespacesL()
IMPORT_C voidRemove()
IMPORT_C MXmlEngUserData *RemoveUserData()
IMPORT_C voidReplaceWith(TXmlEngNode)
IMPORT_C voidReplaceWithL(TXmlEngNode)
IMPORT_C voidSetAsFirstSibling()
IMPORT_C voidSetAsLastSibling()
IMPORT_C voidSetValueL(const TDesC8 &)
IMPORT_C TXmlEngNodeSubstituteForL(TXmlEngNode)
IMPORT_C TXmlEngNodeUnlink()
IMPORT_C MXmlEngUserData *UserData()
IMPORT_C TPtrC8Value()
IMPORT_C voidWholeTextContentsCopyL(RBuf8 &)
Protected Member Functions
voidDoUnlinkNode()
voidLinkBefore(TXmlEngNode)

Detailed Description

This class represents an XML node in the DOM tree.

As the base class for other node types (element, attribute, etc.) this class implements common methods that are similar for all XML node types.

Sample code for tree manipulations:
    RXmlEngDOMImplementation domImpl;
    domImpl.OpenL();        	// opening DOM implementation object 
    RXmlEngDocument iDoc; 		// iDoc with created nodes tree
    TXmlEngNode tmp = iDoc.DocumentElement();
 	// copying first child of iDoc to tmp2 node and appending it
	TXmlEngNode tmp2 = tmp.FirstChild().CopyL();
 	tmp.AppendChildL(tmp2);
 	// copying the second child of iDoc to the last child
 	tmp.FirstChild().NextSibling().CopyToL(tmp.LastChild());
 	// replacing the second to last child with the second child 
 	tmp.LastChild().PreviousSibling().ReplaceWith(tmp.FirstChild().NextSibling());
 	// moving first child of iDoc to second child's children
 	tmp.FirstChild().MoveTo(tmp.FirstChild().NextSibling());	
    iDoc.Close();				// closing all opened objects
    domImpl.Close();

A node is NULL when the internal data pointer is NULL. This is the default state of a newly created node. Many DOM APIs that return TXmlEngNode objects use this NULL state to indicate a failure of some kind. The methods IsNull() and NotNull() can be used to determine whether a node is NULL.

Member Attribute Documentation

iInternal

void *iInternal[protected]

Node pointer

Member Enumeration Documentation

Enum TXmlEngDOMNodeType

The different node types in a XML tree.

EnumeratorValueDescription
EElement1
EAttribute2
EText3
ECDATASection4
EEntityReference5
EEntity6

Not supported

EProcessingInstruction7
EComment8
EDocument9
EDocumentType10

Not supported

EDocumentFragment11
ENotation12

Not supported

ENamespaceDeclaration18

Extension to the DOM spec

EBinaryContainer30

Extension to the DOM spec

EChunkContainer31

Extension to the DOM spec

EFileContainer32

Extension to the DOM spec

Constructor & Destructor Documentation

TXmlEngNode ( )

TXmlEngNode()[inline]

Default constructor

TXmlEngNode ( void * )

TXmlEngNode(void *aInternal)[inline]

Constructor

ParameterDescription
aInternalnode pointer

Member Function Documentation

AddUserData ( MXmlEngUserData * )

IMPORT_C TBoolAddUserData(MXmlEngUserData *aData)

Attaches a user data object to this node. The ownership of the object is transferred. When the node is deleted, the Destroy method of the MXmlEngUserData class will be called. If there is a user data object already associated with this node, it will be deleted before attaching the new object.

Only TXmlEngElement and TXmlEngAttr nodes currently support this feature.

User data is not copied when the node is copied.

ParameterDescription
aDataPointer to the data object.

Returns: ETrue if successful or EFalse if the node type does not support this operation

AppendChildL ( TXmlEngNode )

IMPORT_C TXmlEngNodeAppendChildL(TXmlEngNodeaNewChild)

Append a child node. This is a universal operation for any type of node. Note that some types of nodes cannot have children and some types of nodes are not allowed to be children of some other types. These relationships are not enforced by this function.

leave
KXmlEngErrNullNode Node or aNewChild is NULL
leave
KErrNoMemory Memory allocation failure
leave
  • One of the system-wide error codes

ParameterDescription
aNewChildThe node that should be added as a child

Returns: The appended node, which could be changed as a result of adding it to list of child nodes (e.g. text nodes can coalesce together)

AsAttr ( )

TXmlEngAttr &AsAttr()const [inline]
Cast to an attribute node. Note:
  • Never cast nodes to the wrong node type!

  • Casting removes the const'ness of the node

Returns: This node as an attribute node

AsBinaryContainer ( )

TXmlEngBinaryContainer &AsBinaryContainer()const [inline]
Cast to a binary data container Note:
  • Never cast nodes to the wrong node type!

  • Casting removes the const'ness of the node

Returns: This node as a binary container

AsCDATASection ( )

TXmlEngCDATASection &AsCDATASection()const [inline]
Cast to a CDATA section node. Note:
  • Never cast nodes to the wrong node type!

  • Casting removes the const'ness of the node

Returns: This node as a CDATA section node

AsChunkContainer ( )

TXmlEngChunkContainer &AsChunkContainer()const [inline]
Cast to a memory chunk container Note:
  • Never cast nodes to the wrong node type!

  • Casting removes the const'ness of the node

Returns: This node as a chunk container

AsComment ( )

TXmlEngComment &AsComment()const [inline]
Cast to a comment node. Note:
  • Never cast nodes to the wrong node type!

  • Casting removes the const'ness of the node

Returns: This node as a comment node

AsDataContainer ( )

TXmlEngDataContainer &AsDataContainer()const [inline]
Cast to a memory chunk container Note:
  • Never cast nodes to the wrong node type!

  • Casting removes the const'ness of the node

Returns: This node as a chunk container

AsDocumentFragment ( )

TXmlEngDocumentFragment &AsDocumentFragment()const [inline]
Cast to a Document Fragment. Note:
  • Never cast nodes to the wrong node type!

  • Casting removes the const'ness of the node

Returns: This node as a Document Fragment

AsElement ( )

TXmlEngElement &AsElement()const [inline]
Cast to an element node. Note:
  • Never cast nodes to the wrong node type!

  • Casting removes the const'ness of the node

Returns: This node as an element node

AsEntityReference ( )

TXmlEngEntityReference &AsEntityReference()const [inline]
Cast to an entity reference node. Note:
  • Never cast nodes to the wrong node type!

  • Casting removes the const'ness of the node

Returns: This node as an entity reference node

AsFileContainer ( )

TXmlEngFileContainer &AsFileContainer()const [inline]
Cast to a file container Note:
  • Never cast nodes to the wrong node type!

  • Casting removes the const'ness of the node

Returns: This node as a file container

AsNamespace ( )

TXmlEngNamespace &AsNamespace()const [inline]
Cast to a namespace node. Note:
  • Never cast nodes to the wrong node type!

  • Casting removes the const'ness of the node

Returns: This node as a namespace node

AsProcessingInstruction ( )

TXmlEngProcessingInstruction &AsProcessingInstruction()const [inline]
Cast to a processing instruction node. Note:
  • Never cast nodes to the wrong node type!

  • Casting removes the const'ness of the node

Returns: This node as a Processing instruction node

AsText ( )

TXmlEngTextNode &AsText()const [inline]
Cast to a text node. Note:
  • Never cast nodes to the wrong node type!

  • Casting removes the const'ness of the node

Returns: This node as a text node

BaseUriL ( RBuf8 & )

IMPORT_C voidBaseUriL(RBuf8 &aBaseUri)const

Evaluates the active base URI for the node by processing the xml:base attributes of the parents of the node. If no xml:base attributes exist, an empty string is returned. Any existing content in the specified buffer is destroyed. This function allocates memory for the buffer.

leave
  • One of the system-wide error codes

ParameterDescription
aBaseUriA buffer owned by the caller that holds the result.

CopyL ( )

IMPORT_C TXmlEngNodeCopyL()const

Creates a deep copy of the node. All values and children nodes are copied. Attributes and namespace declarations are also copied for TXmlEngElement nodes. Document nodes cannot be copied with this method. Use RXmlEngDocument::CloneDocumentL() instead.

User data stored with AddUserData() is not copied.

leave
KXmlEngErrNullNode Node is NULL
leave
  • One of the system-wide error codes

Returns: A complete copy of the node or NULL if the node is a document node

CopyToL ( TXmlEngNode )

IMPORT_C TXmlEngNodeCopyToL(TXmlEngNodeaParent)const

Creates a deep copy of the node and appends the subtree as a new child to the provided parent node. Document nodes cannot be copied with this method. Use RXmlEngDocument::CloneDocumentL() instead.

User data stored with AddUserData() is not copied.

leave
KXmlEngErrNullNode Node is NULL
leave
KXmlEngErrWrongUseOfAPI Node is document node
leave
  • One of the system-wide error codes

Returns: Created copy of the node after linking it into the target document tree.

DoUnlinkNode ( )

voidDoUnlinkNode()[protected]

Unlinks the node from the double-linked list and relinks any neighbour nodes. Despite being removed from the list, the node retains links to its old neighbours! Use with care!!

No checks are made. Neither the parent's, nor the node's properties are updated.

FirstChild ( )

IMPORT_C TXmlEngNodeFirstChild()const

Gets the first child

Returns: The first child node or NULL if no children

GetChildNodes ( RXmlEngNodeList< TXmlEngNode > & )

IMPORT_C voidGetChildNodes(RXmlEngNodeList< TXmlEngNode > &aList)const

Gets the list of children.

ParameterDescription
aListThe list of children returned

HasAttributes ( )

IMPORT_C TBoolHasAttributes()const

Check if the node has attributes. Namespace-to-prefix bindings are not considered attributes.

Returns: ETrue if the node is an Element node and has at least one attribute, EFalse otherwise

HasChildNodes ( )

IMPORT_C TBoolHasChildNodes()const

Check if the node has child nodes.

Returns: ETrue if the node has child nodes, EFalse otherwise

InnerXmlL ( RBuf8 & )

IMPORT_C TIntInnerXmlL(RBuf8 &aBuffer)

Get the inner XML string. This method returns all content of the node, exluding node markup. Child nodes will be included. Any existing contents in aBuffer will be destroyed. This method allocates memory for the buffer.

leave
KXmlEngErrWrongUseOfAPI Node is NULL
leave
  • One of the system-wide error codes

ParameterDescription
aBufferA buffer owned by the caller that contains the result

Returns: Length of the output buffer

IsDefaultNamespaceL ( const TDesC8 & )

IMPORT_C TBoolIsDefaultNamespaceL(const TDesC8 &aNamespaceUri)const

Check if the given namespace is the same as the default namespace for this node.

Note: "" or NULL can be used to denote undefined namespace

leave
  • One of the system-wide error codes

ParameterDescription
aNamespaceUriNamespace URI

Returns: ETrue if the node is an element node and its default namespace URI is the same as the given namespace URI, EFalse otherwise

IsNull ( )

TBool IsNull()const [inline]

Check if the node is NULL

Returns: ETrue if node is NULL, otherwise EFalse

IsSameNode ( TXmlEngNode )

TBool IsSameNode(TXmlEngNodeaOther)const [inline]

Checks if a node is the same as this node. Nodes are considered the same if they refer to the same in-memory data structure.

ParameterDescription
aOtherNode to compare

Returns: ETrue if the nodes are the same, EFalse otherwise

IsSimpleTextContents ( )

IMPORT_C TBoolIsSimpleTextContents()const

Check if the node content is "simple text" for element and attribute nodes.

If the node content is "simple text" then it is represented by a single TXmlEngTextNode (or derived type). The contents can be obtained through a call to Value(). A node that has multiple child text nodes does not have node content that is "simple text" and the contents must be obtained through a call to WholeTextContentsCopyL().

The contents of TXmlEngComment, TXmlEngCDATASection, TXmlEngTextNode, and Processing Instuction data are always "simple".

See also: TXmlEngNode::Value() TXmlEngAttr::Value() TXmlEngElement::Text() TXmlEngNode::WholeTextContentsCopyL()

Returns: ETrue if the node is an element or attribute node and content is represented by one TXmlEngTextNode or EFalse otherwise

LastChild ( )

IMPORT_C TXmlEngNodeLastChild()const

Gets the last child

Returns: The last child node or NULL if no children

LinkBefore ( TXmlEngNode )

voidLinkBefore(TXmlEngNodeaNode)[protected]

Inserts this node before the specified node in the double-linked list.

No checks are made. Neither the parent's, nor the node's properties are updated.

ParameterDescription
aNodeAfter insertion, this node will come before aNode in the list

LookupNamespaceUriL ( const TDesC8 & )

IMPORT_C TPtrC8LookupNamespaceUriL(const TDesC8 &aPrefix)const

Searches for the namespace URI that is bound to the given prefix.

See also: TXmlEngElement::LookupNamespaceByPrefixL(const TDesC8&)

leave
KXmlEngErrNullNode The node is NULL
leave
  • One of the system-wide error codes

ParameterDescription
aPrefixThe namespace prefix to search for

Returns: The sought URI or NULL if the prefix is not bound

LookupPrefixL ( const TDesC8 & )

IMPORT_C TPtrC8LookupPrefixL(const TDesC8 &aNamespaceUri)const

Searches for the prefix bound to the given aNamespaceUri and applicable within the scope of this node.

See also: TXmlEngElement::LookupNamespaceByUriL()

leave
KXmlEngErrNullNode The node is NULL
leave
  • One of the system-wide error codes

ParameterDescription
aNamespaceUriThe Namespace URI to search for

Returns: The sought prefix or NULL if not found or if aNamespaceUri is the default namespace

MoveAfterSibling ( TXmlEngNode )

IMPORT_C voidMoveAfterSibling(TXmlEngNodeaSiblingNode)
Moves the node to come after the specified node in the list of sibling nodes. This method does nothing if aSiblingNode is not one of the node's siblings.
Pre-condition
The node has a parent
ParameterDescription
aSiblingNodeThe node is moved to fall after this sibling

MoveBeforeSibling ( TXmlEngNode )

IMPORT_C voidMoveBeforeSibling(TXmlEngNodeaSiblingNode)
Moves the node to come before the specified node in the list of sibling nodes. This method does nothing if aSiblingNode is not one of the node's siblings.
Pre-condition
The node has a parent.
ParameterDescription
aSiblingNodeThe node is moved to fall before this sibling

MoveTo ( TXmlEngNode )

TXmlEngNode MoveTo(TXmlEngNodeaParent)[inline]

Moves the node to another part of the tree or to another document. The node is unlinked from its current postion (if any) and appended to its new parent.

Note: In many cases this method call should be followed by a call to ReconcileNamespacesL().

See also: ReconcileNamespacesL()

leave
KXmlEngErrNullNode The node is NULL
leave
  • One of the system-wide error codes

Deprecated

This method has been deprecated and will be removed in a future release.

ParameterDescription
aParentThis node will be moved to be a child of this node

Returns: This node

MoveToL ( TXmlEngNode )

TXmlEngNode MoveToL(TXmlEngNodeaParent)[inline]

Moves the node to another part of the tree or to another document. The node is unlinked from its current postion (if any) and appended to its new parent.

Note: In many cases this method call should be followed by a call to ReconcileNamespacesL().

leave
KXmlEngErrNullNode The node is NULL
leave
  • One of the system-wide error codes

ParameterDescription
aParentThis node will be moved to be a child of this node

Returns: This node

Name ( )

IMPORT_C TPtrC8Name()const

Gets the node name.

This method generally follows the DOM spec: ------------------------------------------------------------------------------- The values of nodeName, nodeValue, and attributes vary according to the node type as follows:

interface nodeName nodeValue attributes ------------------------------------------------------------------------------- Attr = Attr.name = Attr.value = null CDATASection = "#cdata-section" = CharacterData.data = null Comment = "#comment" = CharacterData.data = null Document = "#document" = null = null DocumentFragment = "#document-fragment" = null = null DocumentType = DocumentType.name = null = null Element = Element.tagName = null = NamedNodeMap Entity = entity name = null = null EntityReference = name of entity referenced = null = null Notation = notation name = null = null ProcessingInstruction = target = data = null Text = "#text" = CharacterData.data = null -------------------------------------------------------------------------------

Returns: The name of the node

NamespaceDeclaration ( )

IMPORT_C TXmlEngNamespaceNamespaceDeclaration()const

Retrieves the namespace declaration that applies to the node's namespace

Note: The DOM spec does not consider namespace declarations as a kind of node. This API adds TXmlEngNamespace, which is derived from TXmlEngNode.

Returns: The namespace declaration and prefix binding that act on the node; returns a NULL object if no namespace associated

NamespaceUri ( )

IMPORT_C TPtrC8NamespaceUri()const

Gets the namespace URI.

Returns: The namespace URI of a TXmlEngNamespace, TXmlEngAttr or TXmlEngElement node if bound, NULL in all other cases.

NextSibling ( )

IMPORT_C TXmlEngNodeNextSibling()const

Gets the next sibling

Returns: The next sibling or NULL if there is no sibling after

NodeType ( )

IMPORT_C TXmlEngDOMNodeTypeNodeType()const

Gets the node type. Used to find out the type of the node prior to casting the node to one of TXmlEngNode class to one of its derived subclasses (TXmlEngElement, TXmlEngAttr, TXmlEngTextNode, etc.).

See also: TXmlEngDOMNodeType

Pre-condition
Node must not be NULL

Returns: The type of the node

NotNull ( )

TBool NotNull()const [inline]

Check if node is not NULL

Returns: ETrue if node is not NULL, otherwise EFalse

OuterXmlL ( RBuf8 & )

IMPORT_C TIntOuterXmlL(RBuf8 &aBuffer)

Get the outer XML string. This method returns all content of the node, including node markup. Child nodes will be included. Any existing contents in aBuffer will be destroyed. This method allocates memory for the buffer.

leave
KXmlEngErrWrongUseOfAPI Node is NULL
leave
KXmlEngErrNegativeOutputSize Output has a negative length
leave
  • One of the system-wide error codes

ParameterDescription
aBufferA buffer owned by the caller that contains the result

Returns: Length of the output buffer

OwnerDocument ( )

IMPORT_C RXmlEngDocumentOwnerDocument()const

Gets the owning document

Note: An instance of the RXmlEngDocument class returns itself

Pre-condition
Node must not be NULL.

Returns: The document node of the DOM tree that this node belongs to or a NULL document if no owning document.

ParentNode ( )

IMPORT_C TXmlEngNodeParentNode()const

Gets the parent node

Returns: The parent node or NULL if no parent exists

Prefix ( )

IMPORT_C TPtrC8Prefix()const

Gets the namespace prefix.

Returns: The prefix of an element or attribute node if bound, NULL in all other cases.

PreviousSibling ( )

IMPORT_C TXmlEngNodePreviousSibling()const

Gets the previous sibling

Returns: The previous sibling or NULL if there is no sibling before

ReconcileNamespacesL ( )

IMPORT_C voidReconcileNamespacesL()

Ensures that namespaces referred to in the node and its descendants are within the scope of the node.

This method checks that all the namespaces declared within the subtree parented by this node are properly declared. This is needed for example after a Copy or an Unlink followed by an Append operation. The subtree may still hold pointers to namespace declarations outside the subtree or they may be invalid/masked. The function tries to reuse the existing namespaces found in the new environment as much as possible. If not possible, the new namespaces are redeclared at the top of the subtree.

This method should be used after unlinking nodes and inserting them into another document tree or into another part of the original tree, if some nodes of the subtree are removed from the scope of the namespace declaration they refer to.

When a node is unlinked, it may still refer to namespace declarations from the previous location. It is important to reconcile the subtree's namespaces if the previous parent tree is to be destroyed. On the other hand, if the parent tree is not changed before pasting its unlinked part into another tree, then reconciliation is needed only after the paste operation.
leave
  • One of the system-wide error codes

Remove ( )

IMPORT_C voidRemove()

Unlinks this node and destroys it; all child nodes are also destroyed and all memory is freed.

Note: Document nodes cannot be removed with this method. Use RXmlEngDocument::Close() instead.

RemoveUserData ( )

IMPORT_C MXmlEngUserData *RemoveUserData()

Removes the user data object attached to this node and transfers ownership to the caller. The user data object is not deleted.

Returns: Pointer to the user data object or NULL if it doesn't exist.

ReplaceWith ( TXmlEngNode )

IMPORT_C voidReplaceWith(TXmlEngNodeaNode)

This node is replaced with another node (or subtree). The replacement node is linked into the document tree instead of this node. The replaced node is destroyed. Replacement of a node with a NULL TXmlEngNode is legal and equivalent to removing the node.

aNode is unlinked from its previous location, which can be none (i.e. not linked), within the same document tree, or within another document tree.

Note: Not applicable to document nodes.

See also: SubstituteForL(TXmlEngNode)

Deprecated

This method has been deprecated and will be removed in a future release.

ParameterDescription
aNodeNode that replaces this node

ReplaceWithL ( TXmlEngNode )

IMPORT_C voidReplaceWithL(TXmlEngNodeaNode)

This node is replaced with another node (or subtree). The replacement node is linked into the document tree instead of this node. The replaced node is destroyed. Replacement of a node with a NULL TXmlEngNode is legal and equivalent to removing the node.

aNode is unlinked from its previous location, which can be none (i.e. not linked), within the same document tree, or within another document tree.

Note: Not applicable to document nodes.

See also: SubstituteForL(TXmlEngNode)

leave
KXmlEngErrNullNode Node is NULL
leave
KXmlEngErrWrongUseOfAPI Node is a document node
leave
  • One of the system-wide error codes

ParameterDescription
aNodeNode that replaces this node

SetAsFirstSibling ( )

IMPORT_C voidSetAsFirstSibling()
Moves the node to become the first in the list of its siblings
Pre-condition
The node has a parent

SetAsLastSibling ( )

IMPORT_C voidSetAsLastSibling()
Moves the node to become the last in the list of its siblings
Pre-condition
The node has a parent.

SetValueL ( const TDesC8 & )

IMPORT_C voidSetValueL(const TDesC8 &aValue)
Copies the specified string and sets the value of this node.
leave
KXmlEngErrNullNode The node is NULL
leave
  • One of the system-wide error codes

ParameterDescription
aValueThe value to set

SubstituteForL ( TXmlEngNode )

IMPORT_C TXmlEngNodeSubstituteForL(TXmlEngNodeaNode)

Unlinks this node and puts another in its place. This function is the same as ReplaceWithL(), but this node is not freed.

aNode is unlinked from its previous location, which can be none (i.e. not linked), within the same document tree, or within another document tree.

It is possible to use a NULL TXmlEngNode object as an argument. In this case, this node will simply be removed from the tree, but not freed.

Note: Not applicable to document nodes.

See also: ReplaceWithL()

leave
KXmlEngErrNullNode Node is NULL
leave
KXmlEngErrWrongUseOfAPI Node is a document node
leave
  • One of the system-wide error codes

ParameterDescription
aNodeNode that replaces current node

Returns: The current node after unlinking it from document tree

Unlink ( )

IMPORT_C TXmlEngNodeUnlink()

Detaches the node from the document tree. The document maintains ownership of the node until it is linked elsewhere.

Note: Remember to use ReconcileNamespacesL() later, if the extracted node (or subtree) contains references to namespace declarations outside of the subtree.

See also: ReconcileNamespacesL()

Returns: This node

UserData ( )

IMPORT_C MXmlEngUserData *UserData()const

Gets the user data object attached to this node. Ownership is not transferred.

Returns: Pointer to data object or NULL if it doesn't exist.

Value ( )

IMPORT_C TPtrC8Value()const

Gets the value of this node.

Note: Since this is not a virtual function, it is better to always cast nodes to a specific type and then use the specific method for getting the "node value".

Returns: The node value

WholeTextContentsCopyL ( RBuf8 & )

IMPORT_C voidWholeTextContentsCopyL(RBuf8 &aOutput)const

Gets a copy of the node's text content. What is returned depends on the node type. Any existing content in the specified buffer is destroyed. This method allocates memory for the buffer.

leave
  • One of the system-wide error codes

ParameterDescription
aOutputA buffer owned by the caller which holds the returned string