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.
std::size_t size () const
 Returns the size of the prefix and local part.
String & prefix ()
 Returns the namespace prefix.
const String & prefix () const
 Returns the namespace prefix.
void setPrefix (const String &prefix)
 Sets the namespace prefix.
String & local ()
 Returns the local name.
const String & local () const
 Returns the local name.
void setLocal (const String &name)
 Sets the local name.

(Note that these are not member symbols.)

bool operator== (const QName &a, const QName &b)
 Returns true if equal.
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.

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.