--- gpl/axl/py-axl/doc/node.rst 2011/06/08 07:09:12 1.1 +++ gpl/axl/py-axl/doc/node.rst 2012/02/17 12:50:03 1.1.1.2 @@ -1,5 +1,5 @@ -:mod:`axl` --- PyAxlNode class: XML node instance -================================================== +:mod:`axl.Node` --- PyAxlNode class: XML node instance +====================================================== .. currentmodule:: axl @@ -108,8 +108,17 @@ Module API :param value: If provided, allows to configure the value on the attribute (attr_name). :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) Allows to configure a new child node. @@ -117,6 +126,13 @@ Module API :param node: the new child node to configure. :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 () Creates a new :class:`axl.AttrCursor` instance which is used to @@ -125,6 +141,30 @@ Module API :param node: the new child node to configure. :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 (Read only attribute) (String) Allows to get the node name. @@ -147,8 +187,18 @@ Module API .. attribute:: content - (Read only attribute) (:class:`axl.Node`) Allows to get the node - content. See axl_node_get_content. + (Read/Write attribute) (:class:`axl.Node`) Allows to get/set the + 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