CopperSpice API  1.7.2
QXmlStreamAttribute Class Reference

Represents a single XML attribute. More...

Public Methods

 QXmlStreamAttribute ()
 
 QXmlStreamAttribute (const QString &namespaceUri, const QString &name, const QString &value)
 
 QXmlStreamAttribute (const QString &qualifiedName, const QString &value)
 
 QXmlStreamAttribute (const QXmlStreamAttribute &other)
 
 ~QXmlStreamAttribute ()
 
bool isDefault () const
 
QStringView name () const
 
QStringView namespaceUri () const
 
bool operator!= (const QXmlStreamAttribute &other) const
 
QXmlStreamAttribute & operator= (const QXmlStreamAttribute &other)
 
bool operator== (const QXmlStreamAttribute &other) const
 
QStringView prefix () const
 
QStringView qualifiedName () const
 
QStringView value () const
 

Friends

class QXmlStreamAttributes
 

Detailed Description

The QXmlStreamAttribute class represents a single XML attribute. An attribute consists of an optionally empty namespaceUri(), a name(), a value(), and an isDefault() attribute. The raw XML attribute name is returned as qualifiedName().

See also
name(), qualifiedName()

Constructor & Destructor Documentation

QXmlStreamAttribute::QXmlStreamAttribute ( )

Creates an empty attribute.

QXmlStreamAttribute::QXmlStreamAttribute ( const QString qualifiedName,
const QString value 
)

Constructs an attribute with qualified name qualifiedName and value value.

QXmlStreamAttribute::QXmlStreamAttribute ( const QString namespaceUri,
const QString name,
const QString value 
)

Constructs an attribute in the namespace described with namespaceUri with name and value value.

QXmlStreamAttribute::QXmlStreamAttribute ( const QXmlStreamAttribute &  other)

Creates a copy of other.

QXmlStreamAttribute::~QXmlStreamAttribute ( )

Destructs an attribute.

Method Documentation

bool QXmlStreamAttribute::isDefault ( ) const
inline

Returns true if the parser added this attribute with a default value following an ATTLIST declaration in the DTD, otherwise returns false.

QStringView QXmlStreamAttribute::name ( ) const
inline

Returns the attribute's local name.

QStringView QXmlStreamAttribute::namespaceUri ( ) const
inline

Returns the attribute's resolved namespaceUri, or an empty string reference if the attribute does not have a defined namespace.

bool QXmlStreamAttribute::operator!= ( const QXmlStreamAttribute &  other) const
inline

Compares this attribute with other and returns true if they are not equal, otherwise returns false.

QXmlStreamAttribute & QXmlStreamAttribute::operator= ( const QXmlStreamAttribute &  other)

Copy assigns from other and returns a reference to this object.

bool QXmlStreamAttribute::operator== ( const QXmlStreamAttribute &  other) const
inline

Compares this attribute with other and returns true if they are equal, otherwise returns false.

QStringView QXmlStreamAttribute::prefix ( ) const
inline

Returns the attribute's namespace prefix.

See also
name(), qualifiedName()
QStringView QXmlStreamAttribute::qualifiedName ( ) const
inline

Returns the attribute's qualified name.

A qualified name is the raw name of an attribute in the XML data. It consists of the namespace prefix(), followed by colon, followed by the attribute's local name(). Since the namespace prefix is not unique (the same prefix can point to different namespaces and different prefixes can point to the same namespace), you should not use qualifiedName(), but the resolved namespaceUri() and the attribute's local name().

QStringView QXmlStreamAttribute::value ( ) const
inline

Returns the attribute's value.