#include <xml/dom/xmlengattr.h>
Link against: xmlenginedom.lib
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
Parameters | |
---|---|
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()
Leave Codes | |
---|---|
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()
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.
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.
See also: TXmlEngAttr::SetValueL(const TDesC8&)
Parameters | |
---|---|
aNewValue | is a new attribute value |
Leave Codes | |
---|---|
KXmlEngErrNullNode | Node is NULL |
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.
See also: SetEscapedValueL(const TDesC8&)
Parameters | |
---|---|
aNewValue | A string value for the attribute |
Leave Codes | |
---|---|
KXmlEngErrNullNode | Node is NULL |
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.
See also: TXmlEngAttr::SetValueL(const TDesC8&)
Parameters | |
---|---|
aNewValue | is the new attribute value |
Leave Codes | |
---|---|
KXmlEngErrNullNode | Node is NULL |
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()
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.
See also: TXmlEngAttr::Value() TXmlEngNode::Value() TXmlEngNode::IsSimpleTextContents() TXmlEngNode::WholeTextContentsCopyL()
Leave Codes | |
---|---|
KXmlEngErrNullNode | Node is NULL |