CSenXmlElement Class Reference

#include <mw/SenXmlElement.h>

Link against: SenXML.dll

class CSenXmlElement : public CSenElement

Inherits from

Public Member Functions
virtual ~CSenXmlElement()
virtual IMPORT_C voidAddAttrL(const TDesC8 &, const TDesC8 &)
virtual IMPORT_C voidAddAttributesL(const RAttributeArray &)
virtual IMPORT_C CSenElement &AddElementL(CSenElement &)
virtual IMPORT_C CSenElement &AddElementL(const TDesC8 &, const TDesC8 &)
virtual IMPORT_C CSenElement &AddElementL(const TDesC8 &, const TDesC8 &, const TDesC8 &)
virtual IMPORT_C CSenElement &AddElementL(const TDesC8 &)
virtual IMPORT_C const CSenNamespace *AddNamespaceL(CSenNamespace &, TBool)
virtual IMPORT_C const CSenNamespace *AddNamespaceL(const TDesC8 &, const TDesC8 &)
virtual IMPORT_C MSenElement *AsElement()
virtual IMPORT_C HBufC8 *AsXmlL()
virtual IMPORT_C HBufC *AsXmlUnicodeL()
virtual IMPORT_C const TDesC8 *AttrValue(const TDesC8 &)
virtual IMPORT_C RPointerArray< CSenBaseAttribute > &AttributesL()
virtual IMPORT_C CSenElement *Child(TInt)
voidCompress()
virtual IMPORT_C TBoolConsistsOfL(MSenElement &)
virtual IMPORT_C TPtrC8Content()
virtual IMPORT_C HBufC *ContentUnicodeL()
virtual IMPORT_C RWriteStream &ContentWriteStreamL()
virtual IMPORT_C voidCopyFromL(CSenElement &)
virtual IMPORT_C CSenElement *CreateElementL(const TDesC8 &, const TDesC8 &)
virtual IMPORT_C CSenElement *DetachL()
virtual IMPORT_C CSenElement *Element(const TDesC8 &)
virtual IMPORT_C CSenElement *Element(const TDesC8 &, const TDesC8 &)
virtual IMPORT_C TIntElementsL(RPointerArray< CSenElement > &, const TDesC8 &, const TDesC8 &)
virtual IMPORT_C TIntElementsL(RPointerArray< CSenElement > &, const TDesC8 &)
virtual IMPORT_C RPointerArray< CSenElement > &ElementsL()
virtual IMPORT_C TBoolHasContent()
virtual IMPORT_C CSenElement &InsertElementL(CSenElement &, const CSenElement &)
virtual IMPORT_C const TDesC8 &LocalName()
virtual IMPORT_C const CSenNamespace *Namespace()
virtual IMPORT_C const CSenNamespace *Namespace(const TDesC8 &)
virtual IMPORT_C const CSenNamespace *Namespace(const TDesC8 &, const TBool)
virtual IMPORT_C const CSenNamespace *Namespace(const TDesC8 &, const TDesC8 &)
virtual IMPORT_C const TDesC8 &NamespaceURI()
virtual IMPORT_C RPointerArray< CSenNamespace > &NamespacesL()
IMPORT_C CSenXmlElement *NewL(const TDesC8 &)
IMPORT_C CSenXmlElement *NewL(const TDesC8 &, const TDesC8 &)
IMPORT_C CSenXmlElement *NewL(const TDesC8 &, const TDesC8 &, const TDesC8 &)
IMPORT_C CSenXmlElement *NewL(const TDesC8 &, const TDesC8 &, const TDesC8 &, const RAttributeArray &)
IMPORT_C CSenXmlElement *NewL(const TDesC8 &, const TDesC8 &, const TDesC8 &, const RAttributeArray &, CSenElement &)
virtual IMPORT_C const TDesC8 &NsPrefix()
virtual IMPORT_C CSenElement *Parent()
virtual IMPORT_C CSenElement *RemoveElement(CSenElement &)
virtual IMPORT_C CSenElement *RemoveElement(const TDesC8 &, const TDesC8 &)
virtual IMPORT_C CSenElement *RemoveElement(const TDesC8 &)
virtual IMPORT_C CSenElement *ReplaceElementL(CSenElement &)
virtual IMPORT_C MSenElement &Root()
virtual IMPORT_C voidSet(const TDesC8 &, const TDesC8 &, const TDesC8 &)
virtual IMPORT_C voidSetAttributesL(const RAttributeArray &)
virtual IMPORT_C TPtrC8SetContentL(const TDesC8 &)
virtual IMPORT_C voidSetNamespaceL(const TDesC8 &)
virtual IMPORT_C voidSetNamespaceL(const TDesC8 &, const TDesC8 &)
virtual IMPORT_C CSenElement *SetParent(CSenElement *)
virtual IMPORT_C voidSetPrefixL(const TDesC8 &)
virtual IMPORT_C voidWriteAsXMLToL(RWriteStream &)
virtual IMPORT_C voidWriteNamespacesToL(RWriteStream &)
Protected Member Functions
CSenXmlElement()
virtual IMPORT_C const TDesC8 &AddAttributeL(const TDesC8 &, const TDesC8 &, const TDesC8 &)
virtual IMPORT_C const TDesC8 &AddAttributeL(const TDesC8 &, const TDesC8 &)
IMPORT_C const TDesC8 &AddAttributeL(CSenBaseAttribute *)
virtual IMPORT_C voidAllocContentBufL()
IMPORT_C voidBaseConstructL(const TDesC8 &)
IMPORT_C voidBaseConstructL(const TDesC8 &, const TDesC8 &)
IMPORT_C voidBaseConstructL(const TDesC8 &, const TDesC8 &, const TDesC8 &)
IMPORT_C voidBaseConstructL(const TDesC8 &, const TDesC8 &, const TDesC8 &, const RAttributeArray &)
IMPORT_C voidBaseConstructL(const TDesC8 &, const TDesC8 &, const TDesC8 &, const RAttributeArray &, CSenElement &)
virtual IMPORT_C CSenBaseAttribute *FindAttr(const TDesC8 &)
virtual IMPORT_C TIntIndexOfElement(const TDesC8 &, const TDesC8 &)
virtual IMPORT_C voidWriteAttrToL(RWriteStream &, const TDesC8 &, const TDesC8 &)
virtual IMPORT_C voidWriteAttrsToL(RWriteStream &)
virtual IMPORT_C voidWriteContentToL(RWriteStream &)
virtual IMPORT_C voidWriteElementsToL(RWriteStream &)
virtual IMPORT_C TPtrC8WriteToBufL(CBufBase &)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()

Detailed Description

Implementation of an XML element functionality Content is stored in UTF-8 form XML. Note, that setting any 8-bit content into XML without encoding it into form of legal is illegal. Instead, one should use encoding methods, like ones introduced in SenXmlUtils class to encode basic entities, or use use some other encoding like MD5 for binary data content.
Since
Series60 3.1

Constructor & Destructor Documentation

CSenXmlElement ( )

IMPORT_CCSenXmlElement()[protected]

C++ default constructor.

~CSenXmlElement ( )

IMPORT_C~CSenXmlElement()[virtual]

Destructor.

Member Function Documentation

AddAttrL ( const TDesC8 &, const TDesC8 & )

IMPORT_C voidAddAttrL(const TDesC8 &aName,
const TDesC8 &aValue
)[virtual]

Reimplemented from CSenElement::AddAttrL(const TDesC8 &,const TDesC8 &)

Adds an attribute. If attribute is already existing, the value of the attribute will be replaced.

AddAttributeL ( const TDesC8 &, const TDesC8 &, const TDesC8 & )

IMPORT_C const TDesC8 &AddAttributeL(const TDesC8 &aQName,
const TDesC8 &aLocalName,
const TDesC8 &aValue
)[protected, virtual]

Adds an attribute into this element. Used also adding new namespaces into the element.

ParameterDescription
aQNameAttribute's qualified name
aLocalNameAttribute's local name
aValueAttribute's value

Returns: value of the attribute as string (TDesC&) Leave codes: KErrSenInvalidCharacters if aLocalName or aQName contain illegal characters. KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.

AddAttributeL ( const TDesC8 &, const TDesC8 & )

IMPORT_C const TDesC8 &AddAttributeL(const TDesC8 &aAttrName,
const TDesC8 &aValue
)[protected, virtual]

Adds an attribute into this element. Used also adding new namespaces into the element.

ParameterDescription
aValueAttribute's value

Returns: value of the attribute as string (TDesC&) Leave codes: KErrSenInvalidCharacters if aLocalName contains illegal characters. KErrSenZeroLengthDescriptor if aAttrName is zero length, or if the local name part of it is zero length.

AddAttributeL ( CSenBaseAttribute * )

IMPORT_C const TDesC8 &AddAttributeL(CSenBaseAttribute *apAttribute)[protected]

Adds an attribute into this element.

ParameterDescription
apAttributeAttribute to be added. Ownership is transferred to this element.

Returns: attribute value as a string (TDesC8&)

AddAttributesL ( const RAttributeArray & )

IMPORT_C voidAddAttributesL(const RAttributeArray &apAttrs)[virtual]

Adds new attributes to the element.

AddElementL ( CSenElement & )

IMPORT_C CSenElement &AddElementL(CSenElement &aElement)[virtual]

Adds an Element to the children elements. Sets this element to be the new parent of the given element.

Returns: the added Element

AddElementL ( const TDesC8 &, const TDesC8 & )

IMPORT_C CSenElement &AddElementL(const TDesC8 &aNsUri,
const TDesC8 &aLocalName
)[virtual]

Constructs and adds a new element to the children elements. Sets this element to be the new parent of the given element.

Returns: the added Element Leave codes: KErrSenInvalidCharacters if aLocalName contains illegal characters. KErrSenZeroLengthDescriptor if aLocalName is zero length.

AddElementL ( const TDesC8 &, const TDesC8 &, const TDesC8 & )

IMPORT_C CSenElement &AddElementL(const TDesC8 &aNsUri,
const TDesC8 &aLocalName,
const TDesC8 &aQName
)[virtual]

Constructs and adds a new element to the children elements. Sets this element to be the new parent of the given element.

Returns: the added Element Leave codes: KErrSenInvalidCharacters if aLocalName or aQName contain illegal characters. KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.

AddElementL ( const TDesC8 & )

IMPORT_C CSenElement &AddElementL(const TDesC8 &aLocalName)[virtual]

Constructs and adds a new element to the children elements. Sets this element to be the new parent of the given element. Note: Element is created with no specific namespace, default namespace of some of the upper level elements are in effect if there is such a namespace.

Returns: the added Element Leave codes: KErrSenInvalidCharacters if aLocalName contains illegal characters. KErrSenZeroLengthDescriptor if aLocalName is zero length.

AddNamespaceL ( CSenNamespace &, TBool )

IMPORT_C const CSenNamespace *AddNamespaceL(CSenNamespace &aNewNamespace,
TBoolaCheckInParent
)[virtual]

Adds a namespace declaration. If this element (or its parent if parameter aCheckInParent is ETrue) already has a Namespace with the same prefix and URI the given Namespace is not added.

Returns: the added Namespace, or the equivalent pre-existing one.

AddNamespaceL ( const TDesC8 &, const TDesC8 & )

IMPORT_C const CSenNamespace *AddNamespaceL(const TDesC8 &aPrefix,
const TDesC8 &aUri
)[virtual]

Method for adding a namespace for the Element.

Returns: the added Namespace, or the equivalent pre-existing one.

AllocContentBufL ( )

IMPORT_C voidAllocContentBufL()[protected, virtual]

Allocates a new buffer for saving content, if none allocated yet.

AsElement ( )

IMPORT_C MSenElement *AsElement()[virtual]

Reimplemented from CSenElement::AsElement()

Gets the current element as XML element. Mostly used to get the classes which implement this interface as an instance of this interface.

Returns: the current object as element. Ownership is NOT transferred.

AsXmlL ( )

IMPORT_C HBufC8 *AsXmlL()[virtual]

Reimplemented from CSenElement::AsXmlL()

Gets the element as an XML buffer. Buffer will contain all the childs

Returns: element as XML. Caller takes ownership.

AsXmlUnicodeL ( )

IMPORT_C HBufC *AsXmlUnicodeL()[virtual]

Reimplemented from CSenElement::AsXmlUnicodeL()

Gets the element as an unicode XML buffer. Buffer will contain all the childs etc.

Returns: element as XML. Caller takes ownership.

AttrValue ( const TDesC8 & )

IMPORT_C const TDesC8 *AttrValue(const TDesC8 &aName)[virtual]

Gets the value of the given attribute.

Returns: the value of the attribute, or NULL if not found. Ownership is NOT TRANSFERRED.

AttributesL ( )

IMPORT_C RPointerArray< CSenBaseAttribute > &AttributesL()[virtual]

Reimplemented from CSenElement::AttributesL()

Gets all the attributes of this element in an array.

Returns: array of attributes. Array will be empty if element has no attributes.

BaseConstructL ( const TDesC8 & )

IMPORT_C voidBaseConstructL(const TDesC8 &aLocalName)[protected]

Following BaseConstructL methods should be called from the deriving classes ConstructL() methods. Parameter info is found in the corresponding NewL-methods.

BaseConstructL ( const TDesC8 &, const TDesC8 & )

IMPORT_C voidBaseConstructL(const TDesC8 &aNsUri,
const TDesC8 &aLocalName
)[protected]

BaseConstructL ( const TDesC8 &, const TDesC8 &, const TDesC8 & )

IMPORT_C voidBaseConstructL(const TDesC8 &aNsUri,
const TDesC8 &aLocalName,
const TDesC8 &aQName
)[protected]

BaseConstructL ( const TDesC8 &, const TDesC8 &, const TDesC8 &, const RAttributeArray & )

IMPORT_C voidBaseConstructL(const TDesC8 &aNsUri,
const TDesC8 &aLocalName,
const TDesC8 &aQName,
const RAttributeArray &apAttrs
)[protected]

BaseConstructL ( const TDesC8 &, const TDesC8 &, const TDesC8 &, const RAttributeArray &, CSenElement & )

IMPORT_C voidBaseConstructL(const TDesC8 &aNsUri,
const TDesC8 &aLocalName,
const TDesC8 &aQName,
const RAttributeArray &apAttrs,
CSenElement &aParent
)[protected]

Child ( TInt )

IMPORT_C CSenElement *Child(TIntaIndex)[virtual]

Reimplemented from CSenElement::Child(TInt)

Gets a child element from a specified index.

Returns: child element from a current index. NULL if no child in given index is found

Compress ( )

voidCompress()

ConsistsOfL ( MSenElement & )

IMPORT_C TBoolConsistsOfL(MSenElement &aCandidate)[virtual]
Checks if element matches to another element by its content and child elements. Element can contain more data than the given pattern.
Since
Series60 3.0
ParameterDescription
aCandidateThe pattern to be matched. Must contain same or less data for match to come true.

Returns: ETrue if content and possible children match exactly to given pattern. EFalse otherwise.

Content ( )

IMPORT_C TPtrC8Content()const [virtual]

Reimplemented from CSenElement::Content()const

Getter for the content of the element.

Returns: the content or KNullDesC if empty.

ContentUnicodeL ( )

IMPORT_C HBufC *ContentUnicodeL()const [virtual]

Getter for the content of the element, unicode version.

Returns: content as unicode. Ownership IS TRANSFERRED to the caller.

ContentWriteStreamL ( )

IMPORT_C RWriteStream &ContentWriteStreamL()[virtual]

Gets the write stream for the content for easy appending. Writing 8-bit (UTF-8) string to the returned stream will be appended to the content.

Returns: reference to the RWriteStream.

CopyFromL ( CSenElement & )

IMPORT_C voidCopyFromL(CSenElement &aSource)[virtual]

Copies content from given element to this element appending to the existing content if there is any.

CreateElementL ( const TDesC8 &, const TDesC8 & )

IMPORT_C CSenElement *CreateElementL(const TDesC8 &aNsPrefix,
const TDesC8 &aLocalName
)[virtual]

Create a new element ready for adding or insertion. If the given namespace prefix is not declared yet the element will not be created and NULL will be returned.

Returns: the new Element just created, or NULL if given prefix was not declared yet. Ownership is transferred to the caller. Leave codes: KErrSenInvalidCharacters if aLocalName contains illegal characters. KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.

DetachL ( )

IMPORT_C CSenElement *DetachL()[virtual]

Reimplemented from CSenElement::DetachL()

Detach the element from its parent. If the element, or one of its children, is dependent on a namespace declared in the scope of the parent copy those namespace declarations to this element.

Returns: this Element. Ownership IS TRANSFERRED to the caller.

Element ( const TDesC8 & )

IMPORT_C CSenElement *Element(const TDesC8 &aLocalName)[virtual]

Gets the child element with the specified local name. Assumes that namespace is the same as this parent element.

Returns: the child element or NULL if the child with the specified local name is not found. Ownership is NOT transferred.

Element ( const TDesC8 &, const TDesC8 & )

IMPORT_C CSenElement *Element(const TDesC8 &aNsUri,
const TDesC8 &aLocalName
)[virtual]

Gets the child element with the specified local name and namespace URI.

Returns: the child element or NULL if the child with the specified criterias is not found. Ownership is NOT transferred.

ElementsL ( RPointerArray< CSenElement > &, const TDesC8 &, const TDesC8 & )

IMPORT_C TIntElementsL(RPointerArray< CSenElement > &aElementArray,
const TDesC8 &aNsUri,
const TDesC8 &aLocalName
)[virtual]

Getting the child elements of this element matching the given criteria.

Returns: KErrNone ok KErrNotFound No child elements exist.

ElementsL ( RPointerArray< CSenElement > &, const TDesC8 & )

IMPORT_C TIntElementsL(RPointerArray< CSenElement > &aElementArray,
const TDesC8 &aLocalName
)[virtual]

Getting the child elements of this element matching the given criteria.

Returns: KErrNone ok KErrNotFound No child elements exist.

ElementsL ( )

IMPORT_C RPointerArray< CSenElement > &ElementsL()[virtual]

Reimplemented from CSenElement::ElementsL()

Getting the child elements of this element.

Returns: an array of child elements. This is an empty array if there are no children. Any modifications made on the returned array modify the element object.

FindAttr ( const TDesC8 & )

IMPORT_C CSenBaseAttribute *FindAttr(const TDesC8 &aName)[protected, virtual]

Method for finding an attribute with given name.

ParameterDescription
aNamea name of the attribute to be searched for

Returns: the 1st attribute with the name, or NULL. Ownership is not transferred.

HasContent ( )

IMPORT_C TBoolHasContent()const [virtual]

Method for checking if the element has any content within.

Returns: ETrue if has content, EFalse if not.

IndexOfElement ( const TDesC8 &, const TDesC8 & )

IMPORT_C TIntIndexOfElement(const TDesC8 &aNsUri,
const TDesC8 &aLocalName
)const [protected, virtual]

Method for finding index for a wanted element.

ParameterDescription
aNsUria namespace URI which needs to match
aLocalNamea local name which needs to match

Returns: Index of the element with given characteristics. or KErrNotFound if none matching

InsertElementL ( CSenElement &, const CSenElement & )

IMPORT_C CSenElement &InsertElementL(CSenElement &aElement,
const CSenElement &aBeforeElement
)[virtual]

Insert an Element into the list of children elements so that the inserted Element is placed right before the aBeforeElement. If aBeforeElement is not found, element will be appended to the last position. Function leaves if error occurs in inserting.

Returns: the inserted Element

LocalName ( )

IMPORT_C const TDesC8 &LocalName()const [virtual]

Getter for Element's local name.

Returns: Localname or KNullDesC if not set.

Namespace ( )

IMPORT_C const CSenNamespace *Namespace()[virtual]

Reimplemented from CSenElement::Namespace()

Getter for Element's namespace.

Returns: const pointer to the CSenNamespace object of this Element. NULL if not set.

Namespace ( const TDesC8 & )

IMPORT_C const CSenNamespace *Namespace(const TDesC8 &aNsPrefix)[virtual]

Getter for new namespace, using a namespace prefix as a search criteria.

ParameterDescription
aNsPrefixis the new namespace prefix for this element

Returns: the found Namespace that is declared for the given prefix within the scope of this Element. If no such prefix is declared return null.

Namespace ( const TDesC8 &, const TBool )

IMPORT_C const CSenNamespace *Namespace(const TDesC8 &aNsPrefix,
const TBoolaCheckInParent
)[virtual]

Getter for new namespace, using a namespace prefix as a search criteria, supporting both normal and recursive search mode (checking the parent).

Returns: the found Namespace that is declared for the given prefix and namespace URI within the scope of this Element or NULL if not found

Namespace ( const TDesC8 &, const TDesC8 & )

IMPORT_C const CSenNamespace *Namespace(const TDesC8 &aNsPrefix,
const TDesC8 &aUri
)[virtual]

Getter for new namespace, using both namespace prefix and namespace URI as search criteria.

Returns: the found Namespace that is declared for the given prefix and namespace URI within the scope of this Element or NULL if not found.

NamespaceURI ( )

IMPORT_C const TDesC8 &NamespaceURI()const [virtual]

Getter for Element's namespace URI.

Returns: Namespace URI or KNullDesC if not set.

NamespacesL ( )

IMPORT_C RPointerArray< CSenNamespace > &NamespacesL()[virtual]

Reimplemented from CSenElement::NamespacesL()

Gets all the namespaces of this element in an array.

Returns: array of namespaces. Array will be empty if element has no namespaces.

NewL ( const TDesC8 & )

IMPORT_C CSenXmlElement *NewL(const TDesC8 &aLocalName)[static]

Standard constructor.

ParameterDescription
aLocalNamethe local name for this element. Leave codes: KErrSenInvalidCharacters if aLocalName contains illegal characters. KErrSenZeroLengthDescriptor if aLocalName is zero length.

NewL ( const TDesC8 &, const TDesC8 & )

IMPORT_C CSenXmlElement *NewL(const TDesC8 &aNsUri,
const TDesC8 &aLocalName
)[static]

Standard constructor.

ParameterDescription
aNsUrithe namespace URI for this element.
aLocalNamethe local name for this element. Leave codes: KErrSenInvalidCharacters if aLocalName contains illegal characters. KErrSenZeroLengthDescriptor if aLocalName is zero length.

NewL ( const TDesC8 &, const TDesC8 &, const TDesC8 & )

IMPORT_C CSenXmlElement *NewL(const TDesC8 &aNsUri,
const TDesC8 &aLocalName,
const TDesC8 &aQName
)[static]

Standard constructor.

ParameterDescription
aNsUrithe namespace URI for this element.
aLocalNamethe local name for this element.
aQNamethe qualified name for this element. Leave codes: KErrSenInvalidCharacters if aLocalName or aQName contains illegal characters. KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.

NewL ( const TDesC8 &, const TDesC8 &, const TDesC8 &, const RAttributeArray & )

IMPORT_C CSenXmlElement *NewL(const TDesC8 &aNsUri,
const TDesC8 &aLocalName,
const TDesC8 &aQName,
const RAttributeArray &apAttrs
)[static]

Standard constructor.

ParameterDescription
aNsUrithe namespace URI for this element.
aLocalNamethe local name for this element.
aQNamethe qualified name for this element.
apAttrsthe attributes for this element. Leave codes: KErrSenInvalidCharacters if aLocalName or aQName contains illegal characters. KErrSenZeroLengthDescriptor if aLocalName or aQName is zero length.

NewL ( const TDesC8 &, const TDesC8 &, const TDesC8 &, const RAttributeArray &, CSenElement & )

IMPORT_C CSenXmlElement *NewL(const TDesC8 &aNsUri,
const TDesC8 &aLocalName,
const TDesC8 &aQName,
const RAttributeArray &apAttrs,
CSenElement &aParent
)[static]

Standard constructor.

ParameterDescription
aNsUrithe namespace URI for this element.
aLocalNamethe local name for this element.
aQNamethe qualified name for this element.
apAttrsthe attributes for this element.

NsPrefix ( )

IMPORT_C const TDesC8 &NsPrefix()const [virtual]

Reimplemented from CSenElement::NsPrefix()const

Getter for namespace prefix of this element.

Returns: namespace prefix or KNullDesC if not set.

Parent ( )

IMPORT_C CSenElement *Parent()[virtual]

Reimplemented from CSenElement::Parent()

Gets the parent element of this element.

Returns: the parent element or NULL if no parent set. Ownership is NOT transferred to the caller.

RemoveElement ( CSenElement & )

IMPORT_C CSenElement *RemoveElement(CSenElement &aElement)[virtual]

Remove an element from the childs.

Returns: The removed element. May be NULL if nothing was removed (if element was not found from the childs). The caller TAKES OWNERSHIP of the removed element.

RemoveElement ( const TDesC8 &, const TDesC8 & )

IMPORT_C CSenElement *RemoveElement(const TDesC8 &aNsUri,
const TDesC8 &aLocalName
)[virtual]

Remove an element from the childs.

Returns: The removed element. May be NULL if nothing was removed (if element was not found from the childs). The caller TAKES OWNERSHIP of the removed element.

RemoveElement ( const TDesC8 & )

IMPORT_C CSenElement *RemoveElement(const TDesC8 &aLocalName)[virtual]

Remove an element from the childs.

Returns: The removed element. May be NULL if nothing was removed (if element was not found from the childs). The caller TAKES OWNERSHIP of the removed element.

ReplaceElementL ( CSenElement & )

IMPORT_C CSenElement *ReplaceElementL(CSenElement &aElement)[virtual]

Replaces an element from the childs with another element. Element's local name and namespace URI will be used to match the element to be replaced. If matching element is not found, will normally add the given element to the childs.

Returns: The old element. May be NULL if nothing was replaced (if element was not found from the childs). The caller TAKES OWNERSHIP of the old element.

Root ( )

IMPORT_C MSenElement &Root()[virtual]

Reimplemented from CSenElement::Root()

Gets the root element. If no parent element, returns this element.

Returns: the root of the tree. Ownership is NOT transferred.

Set ( const TDesC8 &, const TDesC8 &, const TDesC8 & )

IMPORT_C voidSet(const TDesC8 &aNsUri,
const TDesC8 &aLocalName,
const TDesC8 &aQName
)[virtual]

(Re-) Set the name and namespace of this Element. The element will be given the localName in the the given namespace. A prefix will be computed from the qualified name. This method should be used with care and is mainly intended for protected use in implementations.

SetAttributesL ( const RAttributeArray & )

IMPORT_C voidSetAttributesL(const RAttributeArray &apAttrs)[virtual]

Adds attributes to the element. Calls internally AddAttributesL() Can be overridden to replace old attributes.

SetContentL ( const TDesC8 & )

IMPORT_C TPtrC8SetContentL(const TDesC8 &aContent)[virtual]

Sets the content to the element. Old content is overwritten.

Returns: The content of the element or KNullDesC8 if no content was set.

SetNamespaceL ( const TDesC8 & )

IMPORT_C voidSetNamespaceL(const TDesC8 &aNsUri)[virtual]

Setter for Element's namespace URI.

SetNamespaceL ( const TDesC8 &, const TDesC8 & )

IMPORT_C voidSetNamespaceL(const TDesC8 &aNsPrefix,
const TDesC8 &aNsUri
)[virtual]

Setter for Element's namespace URI.

SetParent ( CSenElement * )

IMPORT_C CSenElement *SetParent(CSenElement *apParent)[virtual]

Sets the parent element to this element. Notice that the element is not automatically added as a child of the parent. Parent's AddElementL() should be called instead.

Returns: the parent element

SetPrefixL ( const TDesC8 & )

IMPORT_C voidSetPrefixL(const TDesC8 &aPrefix)[virtual]

Setter for namespace prefix of this element.

WriteAsXMLToL ( RWriteStream & )

IMPORT_C voidWriteAsXMLToL(RWriteStream &aWriteStream)[virtual]

Element writes itself to a write stream using UTF-8 charset encoding.

WriteAttrToL ( RWriteStream &, const TDesC8 &, const TDesC8 & )

IMPORT_C voidWriteAttrToL(RWriteStream &aWriteStream,
const TDesC8 &aName,
const TDesC8 &aValue
)[protected, virtual]

Helper function to write an attribute into a writestream.

ParameterDescription
aWriteStreamwritestream to write into
aNameattribute name
aValueattribute value

WriteAttrsToL ( RWriteStream & )

IMPORT_C voidWriteAttrsToL(RWriteStream &aWriteStream)[protected, virtual]

Writes element's attributes into a writestream.

ParameterDescription
aWriteStreamwritestream to write into

WriteContentToL ( RWriteStream & )

IMPORT_C voidWriteContentToL(RWriteStream &aWriteStream)[protected, virtual]

Writes all element's content into a writestream.

ParameterDescription
aWriteStreamwritestream to write into

WriteElementsToL ( RWriteStream & )

IMPORT_C voidWriteElementsToL(RWriteStream &aWriteStream)[protected, virtual]

Writes all internal elements into a writestream.

ParameterDescription
aWriteStreamwritestream to write into

WriteNamespacesToL ( RWriteStream & )

IMPORT_C voidWriteNamespacesToL(RWriteStream &aWriteStream)[virtual]

Element writes its namespaces to a write stream using UTF-8 charset encoding.

WriteToBufL ( CBufBase & )

IMPORT_C TPtrC8WriteToBufL(CBufBase &aBuf)[protected, virtual]

Writes element into a dynamic buffer.

ParameterDescription
aBufa dynamic buffer where to append everything.

Returns: the modified buffer as TPtrC8.