| Classes - Annotated - Tree - Functions - Home - Structure

# QXmlAttributes Class Reference
[ XML module ]

The QXmlAttributes class provides XML attributes. More...

`#include <qxml.h>`

List of all member functions.

## Public Members

- QXmlAttributes ()
- virtual ~QXmlAttributes ()
- int index ( const QString & qName ) const
- int index ( const QString & uri, const QString & localPart ) const
- int length () const
- QString localName ( int index ) const
- QString qName ( int index ) const
- QString uri ( int index ) const
- QString type ( int index ) const
- QString type ( const QString & qName ) const
- QString type ( const QString & uri, const QString & localName ) const
- QString value ( int index ) const
- QString value ( const QString & qName ) const
- QString value ( const QString & uri, const QString & localName ) const

## Detailed Description

The QXmlAttributes class provides XML attributes.

If attributes are reported by QXmlContentHandler::startElement() this class is used to pass the attribute values. It provides you with different functions to access the attribute names and values.

## Member Function Documentation

### QXmlAttributes::QXmlAttributes ()

Constructs an empty attribute list.

### QXmlAttributes::~QXmlAttributes () `[virtual]`

Destructs attributes.

### int QXmlAttributes::index ( const QString & qName ) const

Look up the index of an attribute by an XML 1.0 qualified name.

Returns the index of the attribute (starting with 0) or -1 if it wasn't found.

See also the namespace description

### int QXmlAttributes::index ( const QString & uri, const QString & localPart ) const

Looks up the index of an attribute by a namespace name.

uri specifies the namespace URI, or the empty string if the name has no namespace URI. localPart specifies the attribute's local name.

Returns the index of the attribute (starting with 0) or -1 if it wasn't found.

See also the namespace description

### int QXmlAttributes::length () const

Returns the number of attributes in the list.

### QString QXmlAttributes::localName ( int index ) const

Looks up an attribute's local name by index (starting with 0).

See also the namespace description

### QString QXmlAttributes::qName ( int index ) const

Looks up an attribute's XML 1.0 qualified name by index (starting with 0).

See also the namespace description

### QString QXmlAttributes::type ( const QString & ) const

Looks up an attribute's type by XML 1.0 qualified name.

At the moment only 'CDATA' is returned.

### QString QXmlAttributes::type ( const QString &, const QString & ) const

Looks up an attribute's type by namespace name.

The first parameter specifies the namespace URI, or the empty string if the name has no namespace URI. The second parameter specifies the attribute's local name.

At the moment only 'CDATA' is returned.

### QString QXmlAttributes::type ( int ) const

Looks up an attribute's type by index (starting with 0).

At the moment only 'CDATA' is returned.

### QString QXmlAttributes::uri ( int index ) const

Looks up an attribute's namespace URI by index (starting with 0).

See also the namespace description

### QString QXmlAttributes::value ( const QString & qName ) const

Looks up an attribute's value by XML 1.0 qualified name.

See also the namespace description

### QString QXmlAttributes::value ( const QString & uri, const QString & localName ) const

Looks up an attribute's value by namespace name.

uri specifies the namespace URI, or the empty string if the name has no namespace URI. localName specifies the attribute's local name.

See also the namespace description

### QString QXmlAttributes::value ( int index ) const

Looks up an attribute's value by index (starting with 0).

Search the documentation, FAQ, qt-interest archive and more (uses www.trolltech.com):

This file is part of the Qt toolkit, copyright © 1995-2001 Trolltech, all rights reserved.