|
version 1.1.1.1, 2011/06/08 07:09:12
|
version 1.1.1.2, 2012/02/17 12:50:03
|
|
Line 1
|
Line 1
|
| :mod:`axl` --- PyAxlNode class: XML node instance | :mod:`axl.Node` --- PyAxlNode class: XML node instance |
| ================================================== | ====================================================== |
| |
|
| .. currentmodule:: axl |
.. currentmodule:: axl |
| |
|
|
Line 108 Module API
|
Line 108 Module API
|
| :param value: If provided, allows to configure the value on the attribute (attr_name). |
:param value: If provided, allows to configure the value on the attribute (attr_name). |
| :type value: String |
:type value: String |
| |
|
| :rtype: Returns an instance of :class:`axl.Node` or None if no node was found. | :rtype: Returns a string if only one parameter is provided representing the attribute value or None if attribute and value are provided. |
| |
|
| |
.. method:: attr_trans (attr_name) |
| |
|
| |
Gets the attribute content for the provided attribute name, at the provided node, but translating entity references found. |
| |
|
| |
:param attr_name: the attribute name to get its value. |
| |
:type attr_name: String |
| |
|
| |
:rtype: Returns a string or None representing the attribute value. |
| |
|
| .. method:: set_child (node) |
.. method:: set_child (node) |
| |
|
| Allows to configure a new child node. |
Allows to configure a new child node. |
|
Line 117 Module API
|
Line 126 Module API
|
| :param node: the new child node to configure. |
:param node: the new child node to configure. |
| :type node: :class:`axl.Node` |
:type node: :class:`axl.Node` |
| |
|
| |
.. method:: set_child_after (node) |
| |
|
| |
Allows to configure a new child node placing it after the calling node inside the same level. Both nodes will share parent node. Node must be not attached to a document. See :meth:`deattach` to disconnect a node from a document or create a new node (:class:`axl.Node`). |
| |
|
| |
:param node: the new child node to configure. |
| |
:type node: :class:`axl.Node` |
| |
|
| .. method:: attr_cursor_new () |
.. method:: attr_cursor_new () |
| |
|
| Creates a new :class:`axl.AttrCursor` instance which is used to |
Creates a new :class:`axl.AttrCursor` instance which is used to |
|
Line 125 Module API
|
Line 141 Module API
|
| :param node: the new child node to configure. |
:param node: the new child node to configure. |
| :type node: axl.Node |
:type node: axl.Node |
| |
|
| |
.. method:: remove ([dealloc=True]) |
| |
|
| |
Allows to remove the node from its current document. By default |
| |
the internal node is deallocated. |
| |
|
| |
:param node: the new node to be removed from current holding document |
| |
:type node: :class:`axl.Node` |
| |
|
| |
.. method:: replace ([dealloc=True]) |
| |
|
| |
Allows to remove the node from its current document. By default |
| |
the internal node is deallocated. |
| |
|
| |
:param node: the new node to be removed from current holding document |
| |
:type node: :class:`axl.Node` |
| |
|
| |
.. method:: deattach () |
| |
|
| |
Allows to disconnect the node from its current document. |
| |
|
| |
.. method:: set_empty () |
| |
|
| |
Allows to clear all content set inside a particular node. |
| |
|
| .. attribute:: name |
.. attribute:: name |
| |
|
| (Read only attribute) (String) Allows to get the node name. |
(Read only attribute) (String) Allows to get the node name. |
|
Line 147 Module API
|
Line 187 Module API
|
| |
|
| .. attribute:: content |
.. attribute:: content |
| |
|
| (Read only attribute) (:class:`axl.Node`) Allows to get the node | (Read/Write attribute) (:class:`axl.Node`) Allows to get/set the |
| content. See axl_node_get_content. | node content. See axl_node_get_content and axl_node_set_content |
| | from C API. The attribute detects on write operations if the |
| | content to be configured is not supported directly without replacing &, <, ', >, ", and ;. In such case, Axl API translate the content (replacing those values by &, <, etc...). |
| | |
| | The attribute returns a tuple with (content, size). |
| | |
| | .. attribute:: trans |
| | |
| | (Read only attribute) (:class:`axl.Node`) Allows to get content stored on a node translating known entity references: &, <, etc.. |
| | |
| | The attribute returns a tuple with (content, size). |
| |
|
| .. attribute:: doc |
.. attribute:: doc |
| |
|