cxxtools::xml::Namespace Class Reference

A Namespace element (Node) of an XML document. More...

#include <cxxtools/xml/namespace.h>

Public Member Functions

 Namespace (const String &namespaceUri, const String &prefix)
 Constructs a new Namespace object with the given namespace URI and prefix.
const Stringprefix () const
 Returns the prefix of this namespace.
void setPrefix (const String &prefix)
 Sets the prefix of this namespace.
const StringnamespaceUri () const
 Returns the URI of this namespace.
void setNamespaceUri (const String &namespaceUri)
 Sets the URI of this namespace.
bool isDefaultNamespaceDeclaration ()
 Returns $true$ if this is the default namespace in the current XML document.

Detailed Description

A Namespace element (Node) of an XML document.

A namespace element stores a namespace uri which describes the namespace URI and a locally usable prefix which can be added before a tag name to specify that this particular tag is part of that namespace.

Use namespaceUri() to get the namespace URI. Use prefix() to get the prefix.

See Also
Node
NamespaceContext

Constructor & Destructor Documentation

cxxtools::xml::Namespace::Namespace ( const String namespaceUri,
const String prefix 
)
inline

Constructs a new Namespace object with the given namespace URI and prefix.

Parameters
namespaceURIThe unique URI of this namespace.
prefixThe namespace prefix which can be added to a tag name to specify that this tag belongs to that namespace.

Member Function Documentation

bool cxxtools::xml::Namespace::isDefaultNamespaceDeclaration ( )

Returns $true$ if this is the default namespace in the current XML document.

Otherwise $false$ is returned.

Returns
$true$ if this is the default namespace; $false$ otherwise.
const String& cxxtools::xml::Namespace::namespaceUri ( ) const
inline

Returns the URI of this namespace.

The URI is unique and identifies the namespace.

Returns
The namespace URI of this Namespace object.
const String& cxxtools::xml::Namespace::prefix ( ) const
inline

Returns the prefix of this namespace.

The namespace prefix can be added to a tag name to specify that this tag belongs to that namespace.

Returns
The namespace prefix of this Namespace object.
void cxxtools::xml::Namespace::setNamespaceUri ( const String namespaceUri)
inline

Sets the URI of this namespace.

The URI is unique and identifies the namespace.

Parameters
namespaceUriThe namespace URI for this Namespace object.
void cxxtools::xml::Namespace::setPrefix ( const String prefix)
inline

Sets the prefix of this namespace.

The namespace prefix can be added to a tag name to specify that this tag belongs to that namespace.

Parameters
prefixThe namespace prefix for this Namespace object.

The documentation for this class was generated from the following file: