#include <xml/dom/xmlengattr.h>
class TXmlEngAttr : public TXmlEngNode |
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 Attributes | |
---|---|
TXmlEngNode::iInternal |
Inherited Enumerations | |
---|---|
TXmlEngNode:TXmlEngDOMNodeType |
This class represents a XML attribute in the DOM tree.
TXmlEngAttr | ( | void * | aInternal | ) | [protected, inline] |
Constructor
Parameter | Description |
---|---|
aInternal | attribute pointer |
IMPORT_C TXmlEngAttr | CopyL | ( | ) | const |
Reimplemented from TXmlEngNode::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)
See also: TXmlEngNode::CopyToL()
One of the system-wide error codes
Returns: A copy of this attribute
IMPORT_C TPtrC8 | Name | ( | ) | const |
Reimplemented from TXmlEngNode::Name()const
Get the attribute name. Equal to TXmlEngNode::Name(), but works faster.
See also: TXmlEngNode::Name()
Returns: Local name of the attribute
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.
Returns: 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.
One of the system-wide error codes
See also: TXmlEngAttr::SetValueL(const TDesC8&)
Parameter | Description |
---|---|
aNewValue | is a new attribute value |
IMPORT_C void | SetValueL | ( | const TDesC8 & | aNewValue | ) |
Reimplemented from TXmlEngNode::SetValueL(const TDesC8 &)
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.
One of the system-wide error codes
See also: SetEscapedValueL(const TDesC8&)
Parameter | Description |
---|---|
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.
One of the system-wide error codes
See also: TXmlEngAttr::SetValueL(const TDesC8&)
Parameter | Description |
---|---|
aNewValue | is the new attribute value |
IMPORT_C TPtrC8 | Value | ( | ) | const |
Reimplemented from TXmlEngNode::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.
See also: IsSimpleContents(), WholeValueCopyL()
Returns: The attribute's value
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.
One of the system-wide error codes
See also: TXmlEngAttr::Value() TXmlEngNode::Value() TXmlEngNode::IsSimpleTextContents() TXmlEngNode::WholeTextContentsCopyL()
Returns: Complex value of the attribute, probably consisting of text nodes and entity references