class TXmlEngAttr : public TXmlEngNode |
This class represents a XML attribute in the DOM tree.
Public Member Functions | |
---|---|
TXmlEngAttr() | |
IMPORT_C TXmlEngAttr | CopyL() |
IMPORT_C TPtrC8 | Name() |
IMPORT_C const TXmlEngElement | OwnerElement() |
IMPORT_C void | SetEscapedValueL(const TDesC8 &) |
IMPORT_C void | SetValueL(const TDesC8 &) |
IMPORT_C void | SetValueNoEncL(const TDesC8 &) |
IMPORT_C TPtrC8 | Value() |
IMPORT_C void | WholeValueCopyL(RBuf8 &) |
Protected Member Functions | |
---|---|
TXmlEngAttr(void *) |
Inherited Enumerations | |
---|---|
TXmlEngNode:TXmlEngDOMNodeType |
Inherited Attributes | |
---|---|
TXmlEngNode::iInternal |
TXmlEngAttr | ( | void * | aInternal | ) | [protected, inline] |
Constructor
void * aInternal | attribute pointer |
IMPORT_C TXmlEngAttr | CopyL | ( | ) | const |
Clones attribute node.
Note: Resets the namespace of the attribute. To avoid this, use TXmlEngNode::CopyToL(), which finds an appropriate or creates a new namespace declaration on the new parent node (argument should be an TXmlEngElement handle)
A copy of this attribute
leave
One of the system-wide error codes
IMPORT_C TPtrC8 | Name | ( | ) | const |
Get the attribute name. Equal to TXmlEngNode::Name(), but works faster.
Local name of the attribute
Node must not be NULL
IMPORT_C const TXmlEngElement | OwnerElement | ( | ) | const |
Get the owner element.
Same as TXmlEngNode::ParentNode() but returns TXmlEngElement instead of TXmlEngNode.
Note: Copies of attributes [TXmlEngAttr::CopyL()] and newly created attribute nodes [RXmlEngDocument::CreateAttributeL()] do not have parent element until they are attached to some element.
If there is no owning element, a NULL element is returned.
TXmlEngElement that contains the attribute
IMPORT_C void | SetEscapedValueL | ( | const TDesC8 & | aNewValue | ) |
Sets the value of the attribute from escaped XML character data that may contain entity references.
If the value contains entity references, then the resulting content of the attribute is a list of TXmlEngTextNode and TXmlEngEntityReference nodes. Predefined entities are converted into characters they represent.
leave
KXmlEngErrNullNode Node is NULL
leave
One of the system-wide error codes
const TDesC8 & aNewValue | is a new attribute value |
IMPORT_C void | SetValueL | ( | const TDesC8 & | aNewValue | ) |
Sets the value of the attribute. The new value should not contain entity references. Entity references are not expanded, but used as text, thus the string "abc & def" is copied directly as "abc & def" without expansion.
leave
KXmlEngErrNullNode Node is NULL
leave
One of the system-wide error codes
const TDesC8 & aNewValue | A string value for the attribute |
IMPORT_C void | SetValueNoEncL | ( | const TDesC8 & | aNewValue | ) |
Sets new attribute value exactly as presented in the string. Predefined entities are not converted into characters they represent.
leave
KXmlEngErrNullNode Node is NULL
leave
One of the system-wide error codes
const TDesC8 & aNewValue | is the new attribute value |
IMPORT_C TPtrC8 | Value | ( | ) | const |
Get the attribute's value. If the value consists of more than one TXmlEngTextNode, as children of the attribute, only the beginning of the value is returned. This happens when the value is represented by list of TXmlEngTextNode and TXmlEngEntityReference nodes.
The attribute's value
IsSimpleContents(), WholeValueCopyL()
IMPORT_C void | WholeValueCopyL | ( | RBuf8 & | aBuffer | ) | const |
Get a copy of attribute content. Since the value may be composed from a set of TXmlEngTextNode and TXmlEngEntityReference nodes, the returned result is a newly allocated RBuf, which should be closed by the caller.
RBuf8 value; attr.WholeValueCopyL(value); ... value.Close();
In most cases using Value() is enough (and it needs no memory allocation). Use IsSimpleTextContents() if there are doubts whether Value() can be used safely.
Complex value of the attribute, probably consisting of text nodes and entity references
leave
KXmlEngErrNullNode Node is NULL
leave
One of the system-wide error codes
RBuf8 & aBuffer |