|  | Home · All Classes · Modules

# QXmlStreamAttribute Class Reference
[QtCore module]

The QXmlStreamAttribute class represents a single XML attribute More...

### Methods

- __init__ (self)
- __init__ (self, QString, QString)
- __init__ (self, QString, QString, QString)
- __init__ (self, QXmlStreamAttribute)
- bool isDefault (self)
- QStringRef name (self)
- QStringRef namespaceUri (self)
- QStringRef prefix (self)
- QStringRef qualifiedName (self)
- QStringRef value (self)

### Special Methods

- bool __eq__ (self, QXmlStreamAttribute)
- bool __ne__ (self, QXmlStreamAttribute)

## 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().

## Method Documentation

### QXmlStreamAttribute.__init__ (self)

Creates an empty attribute.

### QXmlStreamAttribute.__init__ (self, QString, QString)

Constructs an attribute with qualified name qualifiedName and value value.

### QXmlStreamAttribute.__init__ (self, QString, QString, QString)

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

### QXmlStreamAttribute.__init__ (self, QXmlStreamAttribute)

Creates a copy of other.

### bool QXmlStreamAttribute.isDefault (self)

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

### QStringRef QXmlStreamAttribute.name (self)

Returns the attribute's local name.

### QStringRef QXmlStreamAttribute.namespaceUri (self)

### QStringRef QXmlStreamAttribute.prefix (self)

Returns the attribute's namespace prefix.

This function was introduced in Qt 4.4.

See also name() and qualifiedName().

### QStringRef QXmlStreamAttribute.qualifiedName (self)

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 shouldn't use qualifiedName(), but the resolved namespaceUri() and the attribute's local name().

### QStringRef QXmlStreamAttribute.value (self)

Returns the attribute's value.

### bool QXmlStreamAttribute.__eq__ (self, QXmlStreamAttribute)

### bool QXmlStreamAttribute.__ne__ (self, QXmlStreamAttribute)