axl.AttrCursor class represents an iterator cursor that maintains state of the current element selected. It is created using a node (axl.Node) and later calls to axl.AttrCursor.next() and axl.AttrCursor.has_item() are used to check all attributes stored on a node:
# get node
node = doc.get ("/document/child")
# create the cursor
cursor = node.attr_cursor_new ()
while cursor.has_item ():
# print content
print ("found attribute: " + cursor.key + "=" + cursor.value)
# next item
cursor.next ()
Set the cursor to point to the first attribute.
Set the cursor to point to the next attribute.
Check if the cursor is pointing to an item (or previous call to axl.AttrCursor.next() has succeeded.
| Return type: | Returns True in the case the cursor points to an item. Otherwise, False is returned. The method returns False once the cursor have iterated over all attributes. |
|---|
Check if the cursor points to an item that has a next attribute.
| Return type: | Returns True in the case there are a next item. Otherwise, False is returned. |
|---|
(Read only attribute) (String) Allows to get the current attribute name pointed by the cursor.
(Read only attribute) (String) Allows to get the value associated to the attribute pointed by the cursor.