TXmlEngAttr Class Reference

#include <xml/dom/xmlengattr.h>

Link against: xmlenginedom.lib

class TXmlEngAttr : public TXmlEngNode

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 Attributes
TXmlEngNode::iInternal
Inherited Enumerations
TXmlEngNode:TXmlEngDOMNodeType
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

Detailed Description

This class represents a XML attribute in the DOM tree.

Constructor & Destructor Documentation

TXmlEngAttr ( )

TXmlEngAttr()[inline]

Default constructor

TXmlEngAttr ( void * )

TXmlEngAttr(void *aInternal)[protected, inline]

Constructor

ParameterDescription
aInternalattribute pointer

Member Function Documentation

CopyL ( )

IMPORT_C TXmlEngAttrCopyL()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
  • One of the system-wide error codes

Returns: A copy of this attribute

Name ( )

IMPORT_C TPtrC8Name()const

Reimplemented from TXmlEngNode::Name()const

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

Pre-condition
Node must not be NULL

See also: TXmlEngNode::Name()

Returns: Local name of the attribute

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.

Returns: 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

See also: TXmlEngAttr::SetValueL(const TDesC8&)

ParameterDescription
aNewValueis a new attribute value

SetValueL ( const TDesC8 & )

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

leave
KXmlEngErrNullNode Node is NULL
leave
  • One of the system-wide error codes

See also: SetEscapedValueL(const TDesC8&)

ParameterDescription
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

See also: TXmlEngAttr::SetValueL(const TDesC8&)

ParameterDescription
aNewValueis the new attribute value

Value ( )

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

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.

leave
KXmlEngErrNullNode Node is NULL
leave
  • 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