TXmlEngAttr Class Reference

class TXmlEngAttr : public TXmlEngNode

This class represents a XML attribute in the DOM tree.

Inherits from

Public Member Functions
TXmlEngAttr()
IMPORT_C TXmlEngAttrCopyL()
IMPORT_C TPtrC8Name()
IMPORT_C const TXmlEngElementOwnerElement()
IMPORT_C voidSetEscapedValueL(const TDesC8 &)
IMPORT_C voidSetValueL(const TDesC8 &)
IMPORT_C voidSetValueNoEncL(const TDesC8 &)
IMPORT_C TPtrC8Value()
IMPORT_C voidWholeValueCopyL(RBuf8 &)
Protected Member Functions
TXmlEngAttr(void *)
Inherited Functions
TXmlEngNode::AddUserData(MXmlEngUserData *)
TXmlEngNode::AppendChildL(TXmlEngNode)
TXmlEngNode::AsAttr()const
TXmlEngNode::AsBinaryContainer()const
TXmlEngNode::AsCDATASection()const
TXmlEngNode::AsChunkContainer()const
TXmlEngNode::AsComment()const
TXmlEngNode::AsDataContainer()const
TXmlEngNode::AsDocumentFragment()const
TXmlEngNode::AsElement()const
TXmlEngNode::AsEntityReference()const
TXmlEngNode::AsFileContainer()const
TXmlEngNode::AsNamespace()const
TXmlEngNode::AsProcessingInstruction()const
TXmlEngNode::AsText()const
TXmlEngNode::BaseUriL(RBuf8 &)const
TXmlEngNode::CopyToL(TXmlEngNode)const
TXmlEngNode::DoUnlinkNode()
TXmlEngNode::FirstChild()const
TXmlEngNode::GetChildNodes(RXmlEngNodeList< TXmlEngNode > &)const
TXmlEngNode::HasAttributes()const
TXmlEngNode::HasChildNodes()const
TXmlEngNode::InnerXmlL(RBuf8 &)
TXmlEngNode::IsDefaultNamespaceL(const TDesC8 &)const
TXmlEngNode::IsNull()const
TXmlEngNode::IsSameNode(TXmlEngNode)const
TXmlEngNode::IsSimpleTextContents()const
TXmlEngNode::LastChild()const
TXmlEngNode::LinkBefore(TXmlEngNode)
TXmlEngNode::LookupNamespaceUriL(const TDesC8 &)const
TXmlEngNode::LookupPrefixL(const TDesC8 &)const
TXmlEngNode::MoveAfterSibling(TXmlEngNode)
TXmlEngNode::MoveBeforeSibling(TXmlEngNode)
TXmlEngNode::MoveTo(TXmlEngNode)
TXmlEngNode::MoveToL(TXmlEngNode)
TXmlEngNode::NamespaceDeclaration()const
TXmlEngNode::NamespaceUri()const
TXmlEngNode::NextSibling()const
TXmlEngNode::NodeType()const
TXmlEngNode::NotNull()const
TXmlEngNode::OuterXmlL(RBuf8 &)
TXmlEngNode::OwnerDocument()const
TXmlEngNode::ParentNode()const
TXmlEngNode::Prefix()const
TXmlEngNode::PreviousSibling()const
TXmlEngNode::ReconcileNamespacesL()
TXmlEngNode::Remove()
TXmlEngNode::RemoveUserData()
TXmlEngNode::ReplaceWith(TXmlEngNode)
TXmlEngNode::ReplaceWithL(TXmlEngNode)
TXmlEngNode::SetAsFirstSibling()
TXmlEngNode::SetAsLastSibling()
TXmlEngNode::SubstituteForL(TXmlEngNode)
TXmlEngNode::TXmlEngNode()
TXmlEngNode::TXmlEngNode(void *)
TXmlEngNode::Unlink()
TXmlEngNode::UserData()const
TXmlEngNode::WholeTextContentsCopyL(RBuf8 &)const
Inherited Enumerations
TXmlEngNode:TXmlEngDOMNodeType
Inherited Attributes
TXmlEngNode::iInternal

Constructor & Destructor Documentation

TXmlEngAttr()

TXmlEngAttr()[inline]

Default constructor

TXmlEngAttr(void *)

TXmlEngAttr(void *aInternal)[protected, inline]

Constructor

Parameters

void * aInternalattribute pointer

Member Functions Documentation

CopyL()

IMPORT_C TXmlEngAttrCopyL()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)

TXmlEngNode::CopyToL()

A copy of this attribute

leave

  • One of the system-wide error codes

Name()

IMPORT_C TPtrC8Name()const

Get the attribute name. Equal to TXmlEngNode::Name(), but works faster.

Local name of the attribute

Node must not be NULL

TXmlEngNode::Name()

OwnerElement()

IMPORT_C const TXmlEngElementOwnerElement()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

SetEscapedValueL(const TDesC8 &)

IMPORT_C voidSetEscapedValueL(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

TXmlEngAttr::SetValueL(const TDesC8&)

Parameters

const TDesC8 & aNewValueis a new attribute value

SetValueL(const TDesC8 &)

IMPORT_C voidSetValueL(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 &amp; def" is copied directly as "abc &amp; def" without expansion.

leave

KXmlEngErrNullNode Node is NULL

leave

  • One of the system-wide error codes

SetEscapedValueL(const TDesC8&)

Parameters

const TDesC8 & aNewValueA string value for the attribute

SetValueNoEncL(const TDesC8 &)

IMPORT_C voidSetValueNoEncL(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

TXmlEngAttr::SetValueL(const TDesC8&)

Parameters

const TDesC8 & aNewValueis the new attribute value

Value()

IMPORT_C TPtrC8Value()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()

WholeValueCopyL(RBuf8 &)

IMPORT_C voidWholeValueCopyL(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.

Example usage of the API:
       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

TXmlEngAttr::Value()

TXmlEngNode::Value()

TXmlEngNode::IsSimpleTextContents()

TXmlEngNode::WholeTextContentsCopyL()

Parameters

RBuf8 & aBuffer