API published in: S60 3rd Ed
Link against: senxml.lib
Required Capabilities
None
#include <senbaseelement.h>
Inherits CSenElement.
Inherited by CSenFacet, and CSenSoapFault.
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.
Public Member Functions |
|
virtual IMPORT_C | ~CSenBaseElement () |
Destructor. |
|
virtual IMPORT_C void | SetAttributesL (const RAttributeArray &apAttrs) |
Adds attributes to the element. |
|
virtual IMPORT_C const TDesC8 & | LocalName () const |
Getter for Element's local name. |
|
virtual IMPORT_C const TDesC8 & | NamespaceURI () const |
Getter for Element's namespace URI. |
|
virtual IMPORT_C const TDesC8 & | NsPrefix () const |
Getter for namespace prefix of this element. |
|
virtual IMPORT_C void | SetPrefixL (const TDesC8 &aPrefix) |
Setter for namespace prefix of this element. |
|
virtual IMPORT_C TBool | HasContent () const |
Method for checking if the element has any content within. |
|
virtual IMPORT_C TPtrC8 | Content () const |
Getter for the content of the element. |
|
virtual IMPORT_C HBufC * | ContentUnicodeL () const |
Getter for the content of the element, unicode version. |
|
virtual IMPORT_C TPtrC8 | SetContentL (const TDesC8 &aContent) |
Sets the content to the element. |
|
virtual IMPORT_C RWriteStream & | ContentWriteStreamL () |
Gets the write stream for the content for easy appending. |
|
virtual IMPORT_C TBool | ConsistsOfL (MSenElement &aCandidate) |
Checks if element matches to another element by its content and child elements. |
|
virtual IMPORT_C void | SetNamespaceL (const TDesC8 &aNsUri) |
Setter for Element's namespace URI. |
|
virtual IMPORT_C void | SetNamespaceL (const TDesC8 &aNsPrefix, const TDesC8 &aNsUri) |
Setter for Element's namespace URI. |
|
virtual IMPORT_C const CSenNamespace * | AddNamespaceL (CSenNamespace &aNewNamespace, TBool aCheckInParent) |
Adds a namespace declaration. |
|
virtual IMPORT_C const CSenNamespace * | AddNamespaceL (const TDesC8 &aPrefix, const TDesC8 &aUri) |
Method for adding a namespace for the Element. |
|
virtual IMPORT_C const CSenNamespace * | Namespace () |
Getter for Element's namespace. |
|
virtual IMPORT_C const CSenNamespace * | Namespace (const TDesC8 &aNsPrefix) |
virtual IMPORT_C const CSenNamespace * | Namespace (const TDesC8 &aNsPrefix, const TBool aCheckInParent) |
virtual IMPORT_C const CSenNamespace * | Namespace (const TDesC8 &aNsPrefix, const TDesC8 &aUri) |
virtual IMPORT_C TInt | ElementsL (RPointerArray< CSenElement > &aElementArray, const TDesC8 &aNsUri, const TDesC8 &aLocalName) |
Getting the child elements of this element matching the given criteria. |
|
virtual IMPORT_C TInt | ElementsL (RPointerArray< CSenElement > &aElementArray, const TDesC8 &aLocalName) |
Getting the child elements of this element matching the given criteria. |
|
virtual IMPORT_C RPointerArray< CSenElement > & |
ElementsL () |
Getting the child elements of this element. |
|
virtual IMPORT_C RPointerArray< CSenBaseAttribute > & |
AttributesL () |
Gets all the attributes of this element in an array. |
|
virtual IMPORT_C RPointerArray< CSenNamespace > & |
NamespacesL () |
Gets all the namespaces of this element in an array. |
|
virtual IMPORT_C const TDesC8 * | AttrValue (const TDesC8 &aName) |
Gets the value of the given attribute. |
|
virtual IMPORT_C void | AddAttrL (const TDesC8 &aName, const TDesC8 &aValue) |
Adds an attribute. |
|
virtual IMPORT_C CSenElement * | Parent () |
Gets the parent element of this element. |
|
virtual IMPORT_C CSenElement * | SetParent (CSenElement *apParent) |
Sets the parent element to this element. |
|
virtual IMPORT_C MSenElement & | Root () |
Gets the root element. |
|
virtual IMPORT_C CSenElement * | Element (const TDesC8 &aLocalName) |
Gets the child element with the specified local name. |
|
virtual IMPORT_C CSenElement * | Element (const TDesC8 &aNsUri, const TDesC8 &aLocalName) |
Gets the child element with the specified local name and namespace URI. |
|
virtual IMPORT_C CSenElement * | CreateElementL (const TDesC8 &aNsPrefix, const TDesC8 &aLocalName) |
Create a new element ready for adding or insertion. |
|
virtual IMPORT_C CSenElement & | InsertElementL (CSenElement &aElement, const CSenElement &aBeforeElement) |
Insert an Element into the list of children elements so that the inserted Element is placed right before the aBeforeElement.
|
|
virtual IMPORT_C CSenElement & | AddElementL (CSenElement &aElement) |
Adds an Element to the children elements. |
|
virtual IMPORT_C CSenElement & | AddElementL (const TDesC8 &aNsUri, const TDesC8 &aLocalName) |
Constructs and adds a new element to the children elements. |
|
virtual IMPORT_C CSenElement & | AddElementL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName) |
Constructs and adds a new element to the children elements. |
|
virtual IMPORT_C CSenElement & | AddElementL (const TDesC8 &aLocalName) |
Constructs and adds a new element to the children elements. |
|
virtual IMPORT_C CSenElement * | RemoveElement (CSenElement &aElement) |
Remove an element from the childs. |
|
virtual IMPORT_C CSenElement * | RemoveElement (const TDesC8 &aNsUri, const TDesC8 &aLocalName) |
Remove an element from the childs. |
|
virtual IMPORT_C CSenElement * | RemoveElement (const TDesC8 &aLocalName) |
Remove an element from the childs. |
|
virtual IMPORT_C CSenElement * | ReplaceElementL (CSenElement &aElement) |
Replaces an element from the childs with another element. |
|
virtual IMPORT_C HBufC8 * | AsXmlL () |
Gets the element as an XML buffer. |
|
virtual IMPORT_C HBufC * | AsXmlUnicodeL () |
Gets the element as an unicode XML buffer. |
|
virtual IMPORT_C void | WriteAsXMLToL (RWriteStream &aWriteStream) |
Element writes itself to a write stream using UTF-8 charset encoding. |
|
virtual IMPORT_C void | WriteNamespacesToL (RWriteStream &aWriteStream) |
Element writes its namespaces to a write stream using UTF-8 charset encoding. |
|
virtual IMPORT_C MSenElement * | AsElement () |
Gets the current element as XML element. |
|
IMPORT_C void | CopyFromL (CSenElement &aSource) |
Copies content from given element to this element appending to the existing content if there is any. |
|
virtual IMPORT_C CSenElement * | DetachL () |
Detach the element from its parent. |
|
virtual IMPORT_C CSenElement * | Child (TInt aIndex) |
Gets a child element from a specified index. |
|
virtual IMPORT_C void | Set (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName) |
(Re-) Set the name and namespace of this Element. |
|
virtual IMPORT_C void | AddAttributesL (const RAttributeArray &apAttrs) |
Adds new attributes to the element. |
|
Static Public Member Functions |
|
static IMPORT_C CSenBaseElement * | NewL (const TDesC8 &aLocalName) |
Standard constructor. |
|
static IMPORT_C CSenBaseElement * | NewL (const TDesC8 &aNsUri, const TDesC8 &aLocalName) |
Standard constructor. |
|
static IMPORT_C CSenBaseElement * | NewL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName) |
Standard constructor. |
|
static IMPORT_C CSenBaseElement * | NewL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName, const RAttributeArray &apAttrs) |
Standard constructor. |
|
static IMPORT_C CSenBaseElement * | NewL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName, const RAttributeArray &apAttrs, CSenElement &aParent) |
Standard constructor. |
|
Protected Member Functions |
|
IMPORT_C | CSenBaseElement () |
C++ default constructor. |
|
IMPORT_C void | BaseConstructL (const TDesC8 &aLocalName) |
Following BaseConstructL methods should be called from the deriving classes ConstructL() methods. |
|
IMPORT_C void | BaseConstructL (const TDesC8 &aNsUri, const TDesC8 &aLocalName) |
IMPORT_C void | BaseConstructL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName) |
IMPORT_C void | BaseConstructL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName, const RAttributeArray &apAttrs) |
IMPORT_C void | BaseConstructL (const TDesC8 &aNsUri, const TDesC8 &aLocalName, const TDesC8 &aQName, const RAttributeArray &apAttrs, CSenElement &aParent) |
virtual IMPORT_C CSenBaseAttribute * | FindAttr (const TDesC8 &aName) |
Method for finding an attribute with given name. |
|
virtual IMPORT_C TInt | IndexOfElement (const TDesC8 &aNsUri, const TDesC8 &aLocalName) const |
Method for finding index for a wanted element. |
|
virtual IMPORT_C void | WriteAttrsToL (RWriteStream &aWriteStream) |
Writes element's attributes into a writestream. |
|
virtual IMPORT_C void | WriteAttrToL (RWriteStream &aWriteStream, const TDesC8 &aName, const TDesC8 &aValue) |
Helper function to write an attribute into a writestream. |
|
virtual IMPORT_C void | WriteElementsToL (RWriteStream &aWriteStream) |
Writes all internal elements into a writestream. |
|
virtual IMPORT_C void | WriteContentToL (RWriteStream &aWriteStream) |
Writes all element's content into a writestream. |
|
virtual IMPORT_C const TDesC8 & | AddAttributeL (const TDesC8 &aQName, const TDesC8 &aLocalName, const TDesC8 &aValue) |
Adds an attribute into this element. |
|
virtual IMPORT_C const TDesC8 & | AddAttributeL (const TDesC8 &aAttrName, const TDesC8 &aValue) |
Adds an attribute into this element. |
|
IMPORT_C const TDesC8 & | AddAttributeL (CSenBaseAttribute *apAttribute) |
Adds an attribute into this element. |
|
virtual IMPORT_C void | AllocContentBufL () |
Allocates a new buffer for saving content, if none allocated yet. |
|
virtual IMPORT_C TPtrC8 | WriteToBufL (CBufBase &aBuf) |
Writes element into a dynamic buffer. |
|
Destructor. |
|
C++ default constructor. |
|
Adds an attribute into this element.
|
|
Adds an attribute into this element. Used also adding new namespaces into the element.
|
|
Adds an attribute into this element. Used also adding new namespaces into the element.
|
|
Adds new attributes to the element.
Implements CSenElement. |
|
Adds an attribute. If attribute is already existing, the value of the attribute will be replaced. Implements CSenElement. |
|
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.
Implements CSenElement. |
|
Constructs and adds a new element to the children elements. Sets this element to be the new parent of the given element.
Implements CSenElement. |
|
Constructs and adds a new element to the children elements. Sets this element to be the new parent of the given element.
Implements CSenElement. |
|
Adds an Element to the children elements. Sets this element to be the new parent of the given element.
Implements CSenElement. |
|
Method for adding a namespace for the Element.
Implements CSenElement. |
|
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.
Implements CSenElement. |
|
Allocates a new buffer for saving content, if none allocated yet. |
|
Gets the current element as XML element. Mostly used to get the classes which implement this interface as an instance of this interface.
Implements CSenElement. |
|
Gets the element as an XML buffer. Buffer will contain all the childs etc.
Implements CSenElement. |
|
Gets the element as an unicode XML buffer. Buffer will contain all the childs etc.
Implements CSenElement. |
|
Gets all the attributes of this element in an array.
Implements CSenElement. |
|
Gets the value of the given attribute.
Implements CSenElement. |
|
|
|
|
|
Following BaseConstructL methods should be called from the deriving classes ConstructL() methods. Parameter info is found in the corresponding NewL-methods. |
|
Gets a child element from a specified index.
Implements CSenElement. |
|
Checks if element matches to another element by its content and child elements. Element can contain more data than the given pattern.
Implements CSenElement. |
|
Getter for the content of the element.
Implements CSenElement. |
|
Getter for the content of the element, unicode version.
Implements CSenElement. |
|
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.
Implements CSenElement. |
|
Copies content from given element to this element appending to the existing content if there is any.
Implements CSenElement. |
|
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.
Implements CSenElement. |
|
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.
Implements CSenElement. |
|
Gets the child element with the specified local name and namespace URI.
Implements CSenElement. |
|
Gets the child element with the specified local name. Assumes that namespace is the same as this parent element.
Implements CSenElement. |
|
Getting the child elements of this element.
Implements CSenElement. |
|
Getting the child elements of this element matching the given criteria.
Implements CSenElement. |
|
Getting the child elements of this element matching the given criteria.
Implements CSenElement. |
|
Method for finding an attribute with given name.
|
|
Method for checking if the element has any content within.
Implements CSenElement. |
|
Method for finding index for a wanted element.
|
|
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.
Implements CSenElement. |
|
Getter for Element's local name.
Implements CSenElement. |
|
Implements CSenElement. |
|
Implements CSenElement. |
|
Implements CSenElement. |
|
Getter for Element's namespace.
Implements CSenElement. |
|
Gets all the namespaces of this element in an array.
Implements CSenElement. |
|
Getter for Element's namespace URI.
Implements CSenElement. |
|
Standard constructor.
|
|
Standard constructor.
Reimplemented in CSenFacet, and CSenSoapFault. |
|
Standard constructor.
|
|
Standard constructor.
|
|
Standard constructor.
|
|
Getter for namespace prefix of this element.
Implements CSenElement. |
|
Gets the parent element of this element.
Implements CSenElement. |
|
Remove an element from the childs.
Implements CSenElement. |
|
Remove an element from the childs.
Implements CSenElement. |
|
Remove an element from the childs.
Implements CSenElement. |
|
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.
Implements CSenElement. |
|
Gets the root element. If no parent element, returns this element.
Implements CSenElement. |
|
(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.
Implements CSenElement. |
|
Adds attributes to the element. Calls internally AddAttributesL() Can be overridden to replace old attributes.
|
|
Sets the content to the element. Old content is overwritten.
Implements CSenElement. |
|
Setter for Element's namespace URI.
Implements CSenElement. |
|
Setter for Element's namespace URI.
Implements CSenElement. |
|
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.
Implements CSenElement. |
|
Setter for namespace prefix of this element.
Implements CSenElement. |
|
Element writes itself to a write stream using UTF-8 charset encoding.
Implements CSenElement. |
|
Writes element's attributes into a writestream.
|
|
Helper function to write an attribute into a writestream.
|
|
Writes all element's content into a writestream.
|
|
Writes all internal elements into a writestream.
|
|
Element writes its namespaces to a write stream using UTF-8 charset encoding.
Implements CSenElement. |
|
Writes element into a dynamic buffer.
|