TXmlEngNamespace Class Reference

#include <xml/dom/xmlengnamespace.h>

Link against: xmlenginedom.lib

class TXmlEngNamespace : public TXmlEngNode

Inherits from

Public Member Functions
TXmlEngNamespace()
IMPORT_C TBoolIsDefault()
IMPORT_C TBoolIsUndefined()
IMPORT_C TPtrC8Prefix()
IMPORT_C TPtrC8Uri()
Protected Member Functions
TXmlEngNamespace(void *)
TPtrC8 NamespaceUri()
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::CopyL()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::Name()const
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::PreviousSibling()const
TXmlEngNode::ReconcileNamespacesL()
TXmlEngNode::Remove()
TXmlEngNode::RemoveUserData()
TXmlEngNode::ReplaceWith(TXmlEngNode)
TXmlEngNode::ReplaceWithL(TXmlEngNode)
TXmlEngNode::SetAsFirstSibling()
TXmlEngNode::SetAsLastSibling()
TXmlEngNode::SetValueL(const TDesC8 &)
TXmlEngNode::SubstituteForL(TXmlEngNode)
TXmlEngNode::TXmlEngNode()
TXmlEngNode::TXmlEngNode(void *)
TXmlEngNode::Unlink()
TXmlEngNode::UserData()const
TXmlEngNode::Value()const
TXmlEngNode::WholeTextContentsCopyL(RBuf8 &)const

Detailed Description

This class represents an existing namespace declaration in the DOM tree or a namespace node returned in RXmlEngNodeSet as a result of some XPath expression.

All elements and attributes may have a namespace instance associated with them. Once added to an element, a namespace declaration (instance of TXmlEngNamespace) may be referred to by all attributes and descendants of the element (unless the prefix that this namespace-to-prefix binding uses is overriden somewhere below in the document tree).

General rules for namespace handling:

  • A NULL prefix in the namespace node means NO PREFIX. An empty string "" can be used to specify the absence of a prefix when setting it, however, NULL will be stored and returned.

  • A NULL value for a namespace URI is legal only with a NULL prefix and is only used in the undeclaration of a namespace (xmlns="" ). An empty string "" can be used too, however, it will be returned as NULL.

  • A NULL or empty string namespace URI with a non-NULL prefix is illegal acording to the XML specification.

  • The namespace of an element is a default namespace if it has a NULL prefix.

  • Elements with namespace undeclarations (xmlns="" ), have no namespace and are treated as local names.

  • Attributes do not have a default namespace. Even if a namespace is applied at element scope, the default namespace declaration is not applied to the element's attributes (according to the XML specification).

  • The namespace of a node (element or attribute) is undefined if no namespace declaration is associated with it.

  • A node with an undefined namespace is serialized as having no prefix. In general, the DOM API handles the complexity of namespace declaration handling, creating neccessary namespace declarations and undeclaring default namespaces. However, some node-creation methods (e.g. TXmlEngElement::AddNewElementL()) do not ensure that a node created with an undefined namespace (i.e. without a prefix) will be treated after serialization as having the default namespace.

Note: Namespace nodes that are the result of XPath expressions have following restrictions:

  • They cannot be used as namespace definitions, because they are not part of the DOM tree, but rather copies of existing namespace definitions.

  • The namespace prefix is not available because it is not mandated by the DOM Level 3 XPath API. So, in returned copies of the DOM tree, namespace prefix strings are not preserved and Prefix() returns NULL.

Constructor & Destructor Documentation

TXmlEngNamespace ( )

TXmlEngNamespace()[inline]

Default constructor

TXmlEngNamespace ( void * )

TXmlEngNamespace(void *aPtr)[protected, inline]

Constructor

ParameterDescription
aPtrNamespace pointer

Member Function Documentation

IsDefault ( )

IMPORT_C TBoolIsDefault()const

Check if the namespace is default.

Returns: ETrue if the namespace is default (no prefix), EFalse if the namespace is not default (bound to prefix) or the namespace is NULL

IsUndefined ( )

IMPORT_C TBoolIsUndefined()const

Check if the namespace is undefined. A node's namespace is undefined if no namespace declaration is associated with it. This is the same as TXmlEngNode::IsNull().

Returns: ETrue if the namespace is undefined, EFalse otherwise

NamespaceUri ( )

TPtrC8 NamespaceUri()[protected, inline]

This method is inherited from TXmlEngNode. To prevent its use, no function body has been supplied. The method Uri() should be used instead.

See also: Uri().

Prefix ( )

IMPORT_C TPtrC8Prefix()const

Reimplemented from TXmlEngNode::Prefix()const

Gets the namespace prefix.

Returns: The prefix bound in the namespace declaration or an empty string when there is a default namespace or if no binding exists

Uri ( )

IMPORT_C TPtrC8Uri()const

Gets the namespace URI

Returns: Namespace URI string or an empty string if the namespace is either NULL or undeclared (xmlns="" )