QName Class Reference

#include <Pt/Xml/QName.h>

A qualified XML name. More...

Public Member Functions

 QName ()
 Constructs an empty qualified name.
void clear ()
 Clears all content.
bool empty () const
 Returns true if empty.
Stringlocal ()
 Returns the local name.
const Stringlocal () const
 Returns the local name.
Stringprefix ()
 Returns the namespace prefix.
const Stringprefix () const
 Returns the namespace prefix.
void setLocal (const String &name)
 Sets the local name.
void setPrefix (const String &prefix)
 Sets the namespace prefix.
std::size_t size () const
 Returns the size of the prefix and local part.

Related Functions

bool operator!= (const QName &a, const QName &b)
 Returns true if not equal.
bool operator< (const QName &a, const QName &b)
 Returns true if less.
bool operator== (const QName &a, const QName &b)
 Returns true if equal.

Detailed Description

A qualified XML name consists of a prefix separated by a colon from its local name. The prefix is used to refer to a namespace. This allows to distinguish between to attributes or elements with the same local name.