Xmlb.NodeAttrIter

Fields

Name

Type

Access

Description

dummy1

object

r

dummy2

int

r

dummy3

object

r

dummy4

object

r

dummy5

object

r

dummy6

object

r

Methods

init (self)

next ()

Details

class Xmlb.NodeAttrIter

A Xmlb.NodeAttrIter structure represents an iterator that can be used to iterate over the attributes of a Xmlb.Node. Xmlb.NodeAttrIter structures are typically allocated on the stack and then initialized with Xmlb.NodeAttrIter.init().

The iteration order of a Xmlb.NodeAttrIter is not defined.

New in version 0.3.4.

init(self)
Parameters:

self (Xmlb.Node) – a Xmlb.Node

Initializes a name/value pair iterator for the node attributes and associates it with self. The Xmlb.NodeAttrIter structure is typically allocated on the stack and does not need to be freed explicitly.

New in version 0.3.4.

next()
Returns:

True if there are more attributes.

name:

Destination of the returned attribute name

value:

Destination of the returned attribute value

Return type:

(bool, name: str, value: str)

Returns the current attribute name and value and advances the iterator. Example:

XbNodeAttrIter iter;
const gchar *attr_name, *attr_value;

xb_node_attr_iter_init (&iter, node);
while (xb_node_attr_iter_next (&iter, &attr_name, &attr_value)) {
    // use attr_name and attr_value; no need to free them
}

New in version 0.3.4.