class QDomNodeList

The QDomNodeList class is a list of QDomNode objects. More

Synopsis

Methods

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description

Lists can be obtained by elementsByTagName() and childNodes() . The Document Object Model (DOM) requires these lists to be “live”: whenever you change the underlying document, the contents of the list will get updated.

You can get a particular node from the list with item() . The number of items in the list is returned by length() .

For further information about the Document Object Model see Level 1 and Level 2 Core . For a more general introduction of the DOM implementation see the QDomDocument documentation.

__init__()

Creates an empty node list.

__init__(nodeList)
Parameters:

nodeListQDomNodeList

Constructs a copy of nodeList.

at(index)
Parameters:

index – int

Return type:

QDomNode

This function is provided for Qt API consistency. It is equivalent to item() .

If index is negative or if index >= length() then a null node is returned (i.e. a node for which isNull() returns true).

count()
Return type:

int

This function is provided for Qt API consistency. It is equivalent to length() .

isEmpty()
Return type:

bool

Returns true if the list contains no items; otherwise returns false. This function is provided for Qt API consistency.

item(index)
Parameters:

index – int

Return type:

QDomNode

Returns the node at position index.

If index is negative or if index >= length() then a null node is returned (i.e. a node for which isNull() returns true).

See also

length()

length()
Return type:

int

Returns the number of nodes in the list.

__ne__(other)
Parameters:

otherQDomNodeList

Return type:

bool

Returns true the node list other and this node list are not equal; otherwise returns false.

__eq__(other)
Parameters:

otherQDomNodeList

Return type:

bool

Returns true if the node list other and this node list are equal; otherwise returns false.

size()
Return type:

int

This function is provided for Qt API consistency. It is equivalent to length() .