|  | Home · All Classes · Modules

# QXmlStreamAttributes Class Reference
[QtXml module]

The QXmlStreamAttributes class represents a vector of QXmlStreamAttribute. More...

### Methods

- __init__ (self)
- __init__ (self, QXmlStreamAttributes other)
- append (self, QString namespaceUri, QString name, QString value)
- append (self, QString qualifiedName, QString value)
- append (self, QXmlStreamAttribute attribute)
- QXmlStreamAttribute at (self, int i)
- clear (self)
- bool contains (self, QXmlStreamAttribute value)
- int count (self, QXmlStreamAttribute value)
- int count (self)
- fill (self, QXmlStreamAttribute value, int size = -1)
- QXmlStreamAttribute first (self)
- int indexOf (self, QXmlStreamAttribute value, int from = 0)
- insert (self, int i, QXmlStreamAttribute value)
- bool isEmpty (self)
- QXmlStreamAttribute last (self)
- int lastIndexOf (self, QXmlStreamAttribute value, int from = -1)
- prepend (self, QXmlStreamAttribute value)
- remove (self, int i)
- remove (self, int i, int count)
- replace (self, int i, QXmlStreamAttribute value)
- int size (self)
- QStringRef value (self, QString namespaceUri, QString name)
- QStringRef value (self, QString namespaceUri, QLatin1String name)
- QStringRef value (self, QLatin1String namespaceUri, QLatin1String name)
- QStringRef value (self, QString qualifiedName)
- QStringRef value (self, QLatin1String qualifiedName)

### Special Methods

- int __contains__ (self, QXmlStreamAttribute value)
- __delitem__ (self, int i)
- __delitem__ (self, slice slice, QXmlStreamAttributes list)
- bool __eq__ (self, QXmlStreamAttributes other)
- QXmlStreamAttribute __getitem__ (self, int i)
- QXmlStreamAttributes __getitem__ (self, slice slice)
- QXmlStreamAttributes __iadd__ (self, QXmlStreamAttributes other)
- QXmlStreamAttributes __iadd__ (self, QXmlStreamAttribute value)
- int __len__ (self)
- bool __ne__ (self, QXmlStreamAttributes other)
- __setitem__ (self, int i, QXmlStreamAttribute value)
- __setitem__ (self, slice slice, QXmlStreamAttributes list)

## Detailed Description

The QXmlStreamAttributes class represents a vector of QXmlStreamAttribute.

Attributes are returned by a QXmlStreamReader in attributes() when the reader reports a start element. The class can also be used with a QXmlStreamWriter as an argument to writeAttributes().

The convenience function value() loops over the vector and returns an attribute value for a given namespaceUri and an attribute's name.

New attributes can be added with append().

## Method Documentation

### QXmlStreamAttributes.__init__ (self)

### QXmlStreamAttributes.__init__ (self, QXmlStreamAttributes other)

### QXmlStreamAttributes.append (self, QString namespaceUri, QString name, QString value)

Appends a new attribute with name in the namespace described with namespaceUri, and value value. The namespaceUri can be empty.

### QXmlStreamAttributes.append (self, QString qualifiedName, QString value)

This is an overloaded member function, provided for convenience.

Appends the given attribute to the end of the vector.

See also QVector.append().

### QXmlStreamAttributes.append (self, QXmlStreamAttribute attribute)

This is an overloaded member function, provided for convenience.

Appends a new attribute with qualified name qualifiedName and value value.

### QXmlStreamAttribute QXmlStreamAttributes.at (self, int i)

### QXmlStreamAttributes.clear (self)

### bool QXmlStreamAttributes.contains (self, QXmlStreamAttribute value)

### int QXmlStreamAttributes.count (self, QXmlStreamAttribute value)

### int QXmlStreamAttributes.count (self)

### QXmlStreamAttributes.fill (self, QXmlStreamAttribute value, int size = -1)

### QXmlStreamAttribute QXmlStreamAttributes.first (self)

### int QXmlStreamAttributes.indexOf (self, QXmlStreamAttribute value, int from = 0)

### QXmlStreamAttributes.insert (self, int i, QXmlStreamAttribute value)

### bool QXmlStreamAttributes.isEmpty (self)

### QXmlStreamAttribute QXmlStreamAttributes.last (self)

### int QXmlStreamAttributes.lastIndexOf (self, QXmlStreamAttribute value, int from = -1)

### QXmlStreamAttributes.prepend (self, QXmlStreamAttribute value)

### QXmlStreamAttributes.remove (self, int i)

### QXmlStreamAttributes.remove (self, int i, int count)

### QXmlStreamAttributes.replace (self, int i, QXmlStreamAttribute value)

### int QXmlStreamAttributes.size (self)

### QStringRef QXmlStreamAttributes.value (self, QString namespaceUri, QString name)

Returns the value of the attribute name in the namespace described with namespaceUri, or an empty string reference if the attribute is not defined. The namespaceUri can be empty.

### QStringRef QXmlStreamAttributes.value (self, QString namespaceUri, QLatin1String name)

This is an overloaded member function, provided for convenience.

Returns the value of the attribute name in the namespace described with namespaceUri, or an empty string reference if the attribute is not defined. The namespaceUri can be empty.

### QStringRef QXmlStreamAttributes.value (self, QLatin1String namespaceUri, QLatin1String name)

This is an overloaded member function, provided for convenience.

Returns the value of the attribute name in the namespace described with namespaceUri, or an empty string reference if the attribute is not defined. The namespaceUri can be empty.

### QStringRef QXmlStreamAttributes.value (self, QString qualifiedName)

This is an overloaded member function, provided for convenience.

Returns the value of the attribute with qualified name qualifiedName , or an empty string reference if the attribute is not defined. 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 qualified names, but a resolved namespaceUri and the attribute's local name.

### QStringRef QXmlStreamAttributes.value (self, QLatin1String qualifiedName)

This is an overloaded member function, provided for convenience.

Returns the value of the attribute with qualified name qualifiedName , or an empty string reference if the attribute is not defined. 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 qualified names, but a resolved namespaceUri and the attribute's local name.

### int QXmlStreamAttributes.__contains__ (self, QXmlStreamAttribute value)

### QXmlStreamAttributes.__delitem__ (self, int i)

### QXmlStreamAttributes.__delitem__ (self, slice slice, QXmlStreamAttributes list)

### bool QXmlStreamAttributes.__eq__ (self, QXmlStreamAttributes other)

### QXmlStreamAttribute QXmlStreamAttributes.__getitem__ (self, int i)

### QXmlStreamAttributes QXmlStreamAttributes.__getitem__ (self, slice slice)

### QXmlStreamAttributes QXmlStreamAttributes.__iadd__ (self, QXmlStreamAttributes other)

### QXmlStreamAttributes QXmlStreamAttributes.__iadd__ (self, QXmlStreamAttribute value)

### int QXmlStreamAttributes.__len__ (self)

### bool QXmlStreamAttributes.__ne__ (self, QXmlStreamAttributes other)

### QXmlStreamAttributes.__setitem__ (self, int i, QXmlStreamAttribute value)

### QXmlStreamAttributes.__setitem__ (self, slice slice, QXmlStreamAttributes list)