TXmlEngNode Class Reference

Link against: xmlengineDOM.lib


#include <xmlengnode.h>

Inherited by RXmlEngDocument, TXmlEngAttr, TXmlEngCharacterData, TXmlEngDataContainer, TXmlEngDocumentFragment, TXmlEngElement, TXmlEngEntityReference, TXmlEngNamespace, and TXmlEngProcessingInstruction.


Detailed Description

Instance of TXmlEngNode class represents an XML node in the DOM tree.

Class implements methods that are similar for all XML node types i.e. element, attribute.

Sample code for node tree modifications:

      RXmlEngDOMImplementation domImpl;
      domImpl.OpenL();        
      RXmlEngDocument iDoc; 
      TXmlEngNode tmp = iDoc.DocumentElement();
        TXmlEngNode tmp2 = tmp.FirstChild().CopyL();
        tmp.AppendChildL(tmp2);
        tmp.FirstChild().NextSibling().CopyToL(tmp.LastChild());
        tmp.LastChild().PreviousSibling().ReplaceWith(tmp.FirstChild().NextSibling());
        tmp.FirstChild().MoveTo(tmp.FirstChild().NextSibling());        
      iDoc.Close();               
      domImpl.Close();
Dll XmlEngineDOM.lib
Since:
S60 v3.1

Public Types

enum   TXmlEngDOMNodeType {
  EElement = 1, EAttribute = 2, EText = 3, ECDATASection = 4,
  EEntityReference = 5, EEntity = 6, EProcessingInstruction = 7, EComment = 8,
  EDocument = 9, EDocumentType = 10, EDocumentFragment = 11, ENotation = 12,
  ENamespaceDeclaration = 18, EBinaryContainer = 30, EChunkContainer = 31, EFileContainer = 32
}
  The different element types carried by an XML tree. More...

Public Member Functions

  TXmlEngNode ()
  Default constructor.
  TXmlEngNode (void *aInternal)
  Constructor.
TBool  IsNull () const
  Check if node is NULL.
TBool  NotNull () const
  Check if node is NULL.
TXmlEngAttr AsAttr () const
  Cast node to attribute node.
TXmlEngTextNode AsText () const
  Cast node to text node.
TXmlEngBinaryContainer AsBinaryContainer () const
  Cast node to binary data container.
TXmlEngChunkContainer AsChunkContainer () const
  Cast node to memory chunk container.
TXmlEngFileContainer AsFileContainer () const
  Cast node to file container.
TXmlEngDataContainer AsDataContainer () const
  Cast node to memory chunk container.
TXmlEngElement AsElement () const
  Cast node to element node.
TXmlEngComment AsComment () const
  Cast node to comment node.
TXmlEngNamespace AsNamespace () const
  Cast node to namespace node.
TXmlEngCDATASection AsCDATASection () const
  Cast node to CDATA section node.
TXmlEngEntityReference AsEntityReference () const
  Cast node to entity reference node.
TXmlEngProcessingInstruction AsProcessingInstruction () const
  Cast node to processing instruction node.
IMPORT_C TInt  InnerXmlL (RBuf8 &aBuffer)
  Get innerXML string.
IMPORT_C TInt  OuterXmlL (RBuf8 &aBuffer)
  Get outerXML string.
IMPORT_C void  SetAsFirstSibling ()
  Moves the node to become the first in the list of its siblings Node is expected to have a parent.
IMPORT_C void  SetAsLastSibling ()
  Moves the node to become the last in the list of its siblings Node is expected to have a parent.
IMPORT_C void  MoveBeforeSibling (TXmlEngNode aSiblingNode)
  Moves the node in the list of sibling nodes before another node Node is expected to have a parent.
IMPORT_C void  MoveAfterSibling (TXmlEngNode aSiblingNode)
  Moves the node in the list of sibling nodes after another node Node is expected to have a parent.
TXmlEngNode  MoveTo (TXmlEngNode aParent)
  Moves the node to another part of the tree or another document The node is unliked from current postion (if any) and appended to the its new parent.
IMPORT_C TXmlEngNode  Unlink ()
  Detaches a node from document tree.
IMPORT_C void  ReconcileNamespacesL ()
  Ensures that namespaces referred to in the node and its descendants are in the scope the node.
IMPORT_C void  Remove ()
  Unlinks the node and destroys it; all child nodes are destroyed as well and all memory is freed.
IMPORT_C void  ReplaceWith (TXmlEngNode aNode)
  Current node is replaced with another node (subtree).
IMPORT_C TXmlEngNode  SubstituteForL (TXmlEngNode aNode)
  Another node is put instead of the current node.
IMPORT_C TXmlEngNamespace  NamespaceDeclaration () const
  Retrieves a "handle" for namespace declaration that applies to the node's namespace Note: DOM specs do not consider namespace declarations as a kind of nodes This API adds TXmlEngNamespace type of nodes, which is derived from TXmlEngNode.
IMPORT_C TBool  AddUserData (MXmlEngUserData *aData)
  Attaches a user data object to this node.
IMPORT_C MXmlEngUserData UserData () const
  Returns the user data object attached to this node.
IMPORT_C MXmlEngUserData RemoveUserData ()
  Removes the user data onject attached to this node.
IMPORT_C TXmlEngNode  CopyL () const
  Clones the node completely: all attributes and namespace declarations (for TXmlEngElement nodes), values and children nodes are copied as well.
IMPORT_C TXmlEngNode  CopyToL (TXmlEngNode aParent) const
  Creates a deep copy of the node and appends the subtree as a new child to the provided parent node.
IMPORT_C TXmlEngNode  AppendChildL (TXmlEngNode aNewChild)
  Append a child node.
IMPORT_C void  GetChildNodes (RXmlEngNodeList< TXmlEngNode > &aList) const
  Initializes a node list with all children of the node.
IMPORT_C TXmlEngNode  ParentNode () const
  Get parent node of current node.
IMPORT_C TXmlEngNode  FirstChild () const
  Get first child of current node.
IMPORT_C TXmlEngNode  LastChild () const
  Get last child of current node.
IMPORT_C TXmlEngNode  PreviousSibling () const
  Get previous node of current node.
IMPORT_C TXmlEngNode  NextSibling () const
  Get fallowing node of current node.
IMPORT_C RXmlEngDocument  OwnerDocument () const
  Get document handle.
IMPORT_C TPtrC8  Value () const
  Fetches value of this node, depending on its type.
IMPORT_C void  WholeTextContentsCopyL (RBuf8 &aOutput) const
  Get copy of node's text content What is returned depends on the node type.
IMPORT_C void  SetValueL (const TDesC8 &aValue)
  Sets value of this node.
IMPORT_C TBool  IsSimpleTextContents () const
  Check if node content is "simple text".
IMPORT_C TXmlEngDOMNodeType  NodeType () const
  Use NodeType() to find out the type of the node prior to casting object of TXmlEngNode class to one of its derived subclasses (TXmlEngElement, TXmlEngAttr, TXmlEngTextNode, etc.
IMPORT_C TPtrC8  Name () const
  Get node name.
IMPORT_C TBool  HasChildNodes () const
  Check if node has child nodes.
IMPORT_C TBool  HasAttributes () const
  Check if node has attributes.
IMPORT_C void  BaseUriL (RBuf8 &aBaseUri) const
  Evaluates active base URI for the node by processing xml:base attributes of parents.
TBool  IsSameNode (TXmlEngNode aOther) const
  Compares nodes.
IMPORT_C TPtrC8  NamespaceUri () const
  Get namespace uri.
IMPORT_C TPtrC8  Prefix () const
  Get namespace prefix.
IMPORT_C TBool  IsDefaultNamespaceL (const TDesC8 &aNamespaceUri) const
  Check if nemespace is default for this node.
IMPORT_C TPtrC8  LookupPrefixL (const TDesC8 &aNamespaceUri) const
  Searches the prefix that is bound to the given aNamespaceUri and applicable in the scope of this TXmlEngNode.
IMPORT_C TPtrC8  LookupNamespaceUriL (const TDesC8 &aPrefix) const
  Searches the namespace URI that is bound to the given prefix.

Protected Member Functions

void  DoUnlinkNode ()
  Unlinks the internal libxml2's node from double-linked list.
void  LinkBefore (TXmlEngNode aNode)
  Inserts the node in a double-linked list of nodes before specified node.

Protected Attributes

void iInternal
  Node pointer.

Member Enumeration Documentation

enum TXmlEngNode::TXmlEngDOMNodeType
 

The different element types carried by an XML tree.

Note:
This is synchronized with DOM Level 3 values See http://www.w3.org/TR/DOM-Level-3-Core/
Enumerator:
EElement 
EAttribute 
EText 
ECDATASection 
EEntityReference 
EEntity 
EProcessingInstruction 
EComment 
EDocument 
EDocumentType 
EDocumentFragment 
ENotation 
ENamespaceDeclaration 
EBinaryContainer 
EChunkContainer 
EFileContainer 

Constructor & Destructor Documentation

TXmlEngNode::TXmlEngNode  )  [inline]
 

Default constructor.

Since:
S60 v3.1
TXmlEngNode::TXmlEngNode void aInternal  )  [inline]
 

Constructor.

Since:
S60 v3.1
Parameters:
aInternal  node pointer

Member Function Documentation

IMPORT_C TBool TXmlEngNode::AddUserData MXmlEngUserData aData  ) 
 

Attaches a user data object to this node.

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

Since:
S60 v3.1
Parameters:
aData  Pointer to the data object.
Returns:
true if successful, false if for example underlying node type doesn't support attaching user data.
Note:
Only TXmlEngElement and Attribute nodes currently support this feature. User data is not copied, when node is copied.
IMPORT_C TXmlEngNode TXmlEngNode::AppendChildL TXmlEngNode  aNewChild  ) 
 

Append a child node.

This is universal operation for any types of nodes. Note, that some types of nodes cannot have children and some types of nodes are not allowed to be children of some other types.

Since:
S60 v3.1
Parameters:
aNewChild  Child node that should be added
Returns:
Appended node, which could changed as a result of adding it to list of child nodes (e.g. text nodes can coalesce together)
TXmlEngAttr & TXmlEngNode::AsAttr  )  const [inline]
 

Cast node to attribute node.

Since:
S60 v3.1
Returns:
Attribute node
Note:
  • Never cast nodes to a wrong node type!
  • Casting removes const'ness of the node
TXmlEngBinaryContainer & TXmlEngNode::AsBinaryContainer  )  const [inline]
 

Cast node to binary data container.

Since:
S60 v3.2
Returns:
Binary container
Note:
  • Never cast nodes to a wrong node type!
  • Casting removes const'ness of the node
TXmlEngCDATASection & TXmlEngNode::AsCDATASection  )  const [inline]
 

Cast node to CDATA section node.

Since:
S60 v3.1
Returns:
CDATA section node
Note:
  • Never cast nodes to a wrong node type!
  • Casting removes const'ness of the node
TXmlEngChunkContainer & TXmlEngNode::AsChunkContainer  )  const [inline]
 

Cast node to memory chunk container.

Since:
S60 v3.2
Returns:
Chunk container
Note:
  • Never cast nodes to a wrong node type!
  • Casting removes const'ness of the node
TXmlEngComment & TXmlEngNode::AsComment  )  const [inline]
 

Cast node to comment node.

Since:
S60 v3.1
Returns:
Comment node
Note:
  • Never cast nodes to a wrong node type!
  • Casting removes const'ness of the node
TXmlEngDataContainer & TXmlEngNode::AsDataContainer  )  const [inline]
 

Cast node to memory chunk container.

Since:
S60 v3.1
Returns:
Chunk container
Note:
  • Never cast nodes to a wrong node type!
  • Casting removes const'ness of the node
TXmlEngElement & TXmlEngNode::AsElement  )  const [inline]
 

Cast node to element node.

Since:
S60 v3.1
Returns:
Element node
Note:
  • Never cast nodes to a wrong node type!
  • Casting removes const'ness of the node
TXmlEngEntityReference & TXmlEngNode::AsEntityReference  )  const [inline]
 

Cast node to entity reference node.

Since:
S60 v3.1
Returns:
Entity reference node
Note:
  • Never cast nodes to a wrong node type!
  • Casting removes const'ness of the node
TXmlEngFileContainer & TXmlEngNode::AsFileContainer  )  const [inline]
 

Cast node to file container.

Since:
S60 v3.2
Returns:
File container
Note:
  • Never cast nodes to a wrong node type!
  • Casting removes const'ness of the node
TXmlEngNamespace & TXmlEngNode::AsNamespace  )  const [inline]
 

Cast node to namespace node.

Since:
S60 v3.1
Returns:
Namespace node
Note:
  • Never cast nodes to a wrong node type!
  • Casting removes const'ness of the node
TXmlEngProcessingInstruction & TXmlEngNode::AsProcessingInstruction  )  const [inline]
 

Cast node to processing instruction node.

Since:
S60 v3.1
Returns:
Processing instruction node
Note:
  • Never cast nodes to a wrong node type!
  • Casting removes const'ness of the node
TXmlEngTextNode & TXmlEngNode::AsText  )  const [inline]
 

Cast node to text node.

Since:
S60 v3.1
Returns:
Text node
Note:
  • Never cast nodes to a wrong node type!
  • Casting removes const'ness of the node
IMPORT_C void TXmlEngNode::BaseUriL RBuf8 &  aBaseUri  )  const
 

Evaluates active base URI for the node by processing xml:base attributes of parents.

Since:
S60 v3.1
Returns:
A copy of effective base URI for the node
Note:
It's up to the caller to free the string
IMPORT_C TXmlEngNode TXmlEngNode::CopyL  )  const
 

Clones the node completely: all attributes and namespace declarations (for TXmlEngElement nodes), values and children nodes are copied as well.

Document nodes cannot be copied with this method: RXmlEngDocument::CloneDocumentL() must be used.

Since:
S60 v3.1
Returns:
Complete copy of a node or leaves.
Note:
The node should not be NULL!

Reimplemented in TXmlEngAttr, RXmlEngDocument, and TXmlEngElement.

IMPORT_C TXmlEngNode TXmlEngNode::CopyToL TXmlEngNode  aParent  )  const
 

Creates a deep copy of the node and appends the subtree as a new child to the provided parent node.

Since:
S60 v3.1
Returns:
Created copy of the node after linking it into the target document tree.
Note:
Document nodes cannot be copied with this method; use RXmlEngDocument::CloneDocumentL()
void TXmlEngNode::DoUnlinkNode  )  [protected]
 

Unlinks the internal libxml2's node from double-linked list.

Relinks neighbour nodes.The node stays virtually linked to its old neighbours! Use with care!!

No checks are made; nor parent's, nor node's properties updated

Since:
S60 v3.1
IMPORT_C TXmlEngNode TXmlEngNode::FirstChild  )  const
 

Get first child of current node.

Since:
S60 v3.1
Returns:
The first child node or NULL if no children
IMPORT_C void TXmlEngNode::GetChildNodes RXmlEngNodeList< TXmlEngNode > &  aList  )  const
 

Initializes a node list with all children of the node.

Since:
S60 v3.1
Parameters:
aList  node list that should be initialized
IMPORT_C TBool TXmlEngNode::HasAttributes  )  const
 

Check if node has attributes.

Since:
S60 v3.1
Returns:
True if the node is TXmlEngElement and has at least one attribute
Note:
Namespace-to-prefix bindings are not attributes.
IMPORT_C TBool TXmlEngNode::HasChildNodes  )  const
 

Check if node has child nodes.

Since:
S60 v3.1
Returns:
True if the node is TXmlEngElement and has at least one child node
IMPORT_C TInt TXmlEngNode::InnerXmlL RBuf8 &  aBuffer  ) 
 

Get innerXML string.

This method returns all content of the node. Output text does not include node markup.

Since:
S60 v3.1
Parameters:
aBuffer  RBuf8 in which output should be save
Returns:
Size of output buffer
Note:
Returned RBuf8 should be freed
IMPORT_C TBool TXmlEngNode::IsDefaultNamespaceL const TDesC8 &  aNamespaceUri  )  const
 

Check if nemespace is default for this node.

Since:
S60 v3.1
Parameters:
aNamespaceUri  Namespace URI
Returns:
True if given namespace URI is a default one for the node (applicable to elements only)
Note:
"" or NULL can be used to denote undefined namespace
TBool TXmlEngNode::IsNull  )  const [inline]
 

Check if node is NULL.

Since:
S60 v3.1
Returns:
TRUE if node is NULL in other case FALSE
TBool TXmlEngNode::IsSameNode TXmlEngNode  aOther  )  const [inline]
 

Compares nodes.

The nodes are the same if they are referring to the same in-memory data structure.

Since:
S60 v3.1
Parameters:
aOther  Node to compare
Returns:
TRUE if the same
IMPORT_C TBool TXmlEngNode::IsSimpleTextContents  )  const
 

Check if node content is "simple text".

Since:
S60 v3.1
Returns:
Whether the value of the node is presented by only one TXmlEngTextNode node
If the value is "simple text" then it is possible to access it as TDOMString without making copy, which combines values of all text nodes and entity reference nodes.
See also:
TXmlEngNode::Value(), TXmlEngAttr::Value(), TXmlEngElement::Text()
This method is applicable to TXmlEngElement and TXmlEngAttr nodes. On other nodes FALSE is returned.
Note:
Values (contents) of TXmlEngComment, TXmlEngCDATASection, TXmlEngTextNode, ProcessingInstuction data are always "simple".
When the returned result is FALSE, getting value of the node would not returned whole contents because of either entity references present in the contents or the contents is mixed (for TXmlEngElement node). In this case WholeTextContentsCopyL() should be used.
See also:
TXmlEngNode::WholeTextContentsCopyL()
IMPORT_C TXmlEngNode TXmlEngNode::LastChild  )  const
 

Get last child of current node.

Since:
S60 v3.1
Returns:
The last child node or NULL if no children
void TXmlEngNode::LinkBefore TXmlEngNode  aNode  )  [protected]
 

Inserts the node in a double-linked list of nodes before specified node.

No checks are made; nor parent's, nor node's properties updated (except prev/next)

Since:
S60 v3.1
Parameters:
aNode  Target node
IMPORT_C TPtrC8 TXmlEngNode::LookupNamespaceUriL const TDesC8 &  aPrefix  )  const
 

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

Since:
S60 v3.1
Parameters:
aPrefix  Namespace prefix that should be found
Returns:
A sought URI or NULL if the prefix is not bound
See also:
TXmlEngElement::LookupNamespaceByPrefixL(const TDesC8&)
IMPORT_C TPtrC8 TXmlEngNode::LookupPrefixL const TDesC8 &  aNamespaceUri  )  const
 

Searches the prefix that is bound to the given aNamespaceUri and applicable in the scope of this TXmlEngNode.

Since:
S60 v3.1
Parameters:
aNamespaceUri  Namespace Uri that should be found
Returns:
A sought prefix or NULL if not found or aNamespaceUri is the default namespace
See also:
TXmlEngElement::LookupNamespaceByUriL(const TDesC8&)
IMPORT_C void TXmlEngNode::MoveAfterSibling TXmlEngNode  aSiblingNode  ) 
 

Moves the node in the list of sibling nodes after another node Node is expected to have a parent.

Do nothing if aSiblingNode is not one of the node's siblings

Since:
S60 v3.1
Parameters:
aSiblingNode  Node that should be after current node
IMPORT_C void TXmlEngNode::MoveBeforeSibling TXmlEngNode  aSiblingNode  ) 
 

Moves the node in the list of sibling nodes before another node Node is expected to have a parent.

Do nothing if aSiblingNode is not one of node's siblings

Since:
S60 v3.1
Parameters:
aSiblingNode  Node that should be after current node
TXmlEngNode TXmlEngNode::MoveTo TXmlEngNode  aParent  )  [inline]
 

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

Since:
S60 v3.1
Parameters:
aParent  Parent node
Returns:
Node handle
Note:
In many cases this method call should be followed by ReconcileNamespacesL() on the moved node
IMPORT_C TPtrC8 TXmlEngNode::Name  )  const
 

Get node name.

Since:
S60 v3.1
Returns:
Name of the node
This method generally follows 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 -------------------------------------------------------------------------------

Reimplemented in TXmlEngAttr.

IMPORT_C TXmlEngNamespace TXmlEngNode::NamespaceDeclaration  )  const
 

Retrieves a "handle" for namespace declaration that applies to the node's namespace Note: DOM specs do not consider namespace declarations as a kind of nodes This API adds TXmlEngNamespace type of nodes, which is derived from TXmlEngNode.

Since:
S60 v3.1
Returns:
Object that represents namespace declaration and prefix binding that act on the node; returns NULL object (check using TXmlEngNamespace.IsNull() or TXmlEngNamespace.NotNull()) if no namespace associated
IMPORT_C TPtrC8 TXmlEngNode::NamespaceUri  )  const
 

Get namespace uri.

Since:
S60 v3.1
Returns:
Namespace URI of a node
  • NULL is returned for elements and attributes that do not belong to any namespace.
  • bound namespace URI is returned for namespace declaration nodes (instances of TXmlEngNamespace).
  • NULL is returned to all other types of node.
Note:
use IsNull() and NotNull() for testing returned result on the subject of having some URI
IMPORT_C TXmlEngNode TXmlEngNode::NextSibling  )  const
 

Get fallowing node of current node.

Since:
S60 v3.1
Returns:
Following node in a child list or NULL if no sibling after
IMPORT_C TXmlEngDOMNodeType TXmlEngNode::NodeType  )  const
 

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

)

Since:
S60 v3.1
Returns:
Type of the node
See also:
TXmlEngDOMNodeType
TBool TXmlEngNode::NotNull  )  const [inline]
 

Check if node is NULL.

Since:
S60 v3.1
Returns:
TRUE if node is not NULL in other case FALSE
IMPORT_C TInt TXmlEngNode::OuterXmlL RBuf8 &  aBuffer  ) 
 

Get outerXML string.

This method returns all content of the node. Output text includes node markup.

Since:
S60 v3.1
Parameters:
aBuffer  RBuf8 in which output should be save
Returns:
Size of output buffer
Note:
Returned RBuf8 should be freed
IMPORT_C RXmlEngDocument TXmlEngNode::OwnerDocument  )  const
 

Get document handle.

Since:
S60 v3.1
Returns:
A document node of the DOM tree this node belongs to
Note:
An instance of RXmlEngDocument class returns itself
IMPORT_C TXmlEngNode TXmlEngNode::ParentNode  )  const
 

Get parent node of current node.

Since:
S60 v3.1
Returns:
Parent node of the node or NULL if no parent
IMPORT_C TPtrC8 TXmlEngNode::Prefix  )  const
 

Get namespace prefix.

Since:
S60 v3.1
Returns:
Prefix of a node Returns NULL for elements and attributes that do not have prefix (node belongs to the default namespace or does not belong to any namespace) NULL is also returned for all types of node other than TXmlEngElement or TXmlEngAttr

Reimplemented in TXmlEngNamespace.

IMPORT_C TXmlEngNode TXmlEngNode::PreviousSibling  )  const
 

Get previous node of current node.

Since:
S60 v3.1
Returns:
Previous node in a child list or NULL if no sibling before
IMPORT_C void TXmlEngNode::ReconcileNamespacesL  ) 
 

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

This method checks that all the namespaces declared within the given tree are properly declared. This is needed for example after Copy or Unlink and then Append operations. The subtree may still hold pointers to namespace declarations outside the subtree or they may be invalid/masked. As much as possible the function try to reuse the existing namespaces found in the new environment. If not possible, the new namespaces are redeclared on the top of the subtree.

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

When node is unlinked, it may still refer to namespace declarations from the previous location. It is important to reconcile subtree's namespaces if 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 paste operation.

Since:
S60 v3.1
IMPORT_C void TXmlEngNode::Remove  ) 
 

Unlinks the node and destroys it; all child nodes are destroyed as well and all memory is freed.

Note:
Document nodes cannot be "removed" with this method, uses RXmlEngDocument-specific methods.
Since:
S60 v3.1

Reimplemented in RXmlEngDocument.

IMPORT_C MXmlEngUserData* TXmlEngNode::RemoveUserData  ) 
 

Removes the user data onject attached to this node.

Ownership is transferred (the object is not deleted).

Since:
S60 v3.1
Returns:
Pointer to data object or NULL if it doesn't exist.
IMPORT_C void TXmlEngNode::ReplaceWith TXmlEngNode  aNode  ) 
 

Current node is replaced with another node (subtree).

The replacement node is linked into document tree instead of this node. The replaced node is destroyed.

Since:
S60 v3.1
Parameters:
aNode  Node that repleace current node
See also:
SubstituteFor(TXmlEngNode)
In both cases the argument node is unlinked from its previous location (which can be NONE, i.e. not linked; SAME or ANOTHER document tree).
Note:
Replacement of a node with NULL TXmlEngNode is legal and equivalent to removing the node.

Not applicable to document nodes

Reimplemented in RXmlEngDocument.

IMPORT_C void TXmlEngNode::SetAsFirstSibling  ) 
 

Moves the node to become the first in the list of its siblings Node is expected to have a parent.

Since:
S60 v3.1
IMPORT_C void TXmlEngNode::SetAsLastSibling  ) 
 

Moves the node to become the last in the list of its siblings Node is expected to have a parent.

Since:
S60 v3.1
IMPORT_C void TXmlEngNode::SetValueL const TDesC8 &  aValue  ) 
 

Sets value of this node.

Since:
S60 v3.1
Parameters:
aValue  New value

Reimplemented in TXmlEngAttr.

IMPORT_C TXmlEngNode TXmlEngNode::SubstituteForL TXmlEngNode  aNode  ) 
 

Another node is put instead of the current node.

Does the same as ReplaceWith(TXmlEngNode) but does not free node and just returns it.

Since:
S60 v3.1
Parameters:
aNode  Node that repleace current node
Returns:
Current node after unlinking it from document tree
See also:
ReplaceWith(TXmlEngNode)
In both cases the argument node is unlinked from its previous location (which can be NONE, i.e. not linked; SAME or ANOTHER document tree)

It is possible to use NULL TXmlEngNode object as an argument. In such case no new node will be put instead of unlinked one.

Note:
Not applicable to document nodes
IMPORT_C TXmlEngNode TXmlEngNode::Unlink  ) 
 

Detaches a node from document tree.

Since:
S60 v3.1
Returns:
This node, which is already not a part of any document
Note:
Remember to use ReconcileNamespacesL() later, if extracted node (subtree) contains references to namespace declarations outside of the subtree.
See also:
ReconcileNamespacesL()
Note:
The document, from which the is being unlinked, becomes an owner of the node until it is linked elsewhere.
IMPORT_C MXmlEngUserData* TXmlEngNode::UserData  )  const
 

Returns the user data object attached to this node.

Ownership is not transferred.

Since:
S60 v3.1
Returns:
Pointer to data object or NULL if it doesn't exist.
IMPORT_C TPtrC8 TXmlEngNode::Value  )  const
 

Fetches value of this node, depending on its type.

Note:
It is better to always cast nodes to specific type and then use specific method for getting "node value"
Since:
S60 v3.1
Returns:
Node value

Reimplemented in TXmlEngAttr.

IMPORT_C void TXmlEngNode::WholeTextContentsCopyL RBuf8 &  aOutput  )  const
 

Get copy of node's text content What is returned depends on the node type.

Method caller is responsible for freeing returned string.

Since:
S60 v3.1
Returns:
the content of the node

Field Documentation

void* TXmlEngNode::iInternal [protected]
 

Node pointer.


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

Copyright © Nokia Corporation 2001-2007
Back to top