Description
The BonoboUINode API is designed to make XML node manipulation
simple, and to hide the underlying implementation of the XML tree.
This is since libxml is both horrendously inefficient in terms of
both memory and speed for the simple application of storing trees
of attributed utf-8 strings. It also provides workarounds for
several bugs in libxml ( pwrt. switching nodes in between trees ).
Details
struct BonoboUINode
The BonoboUINode structure is fully opaque to stop any code
depending on libxml inadvertantly.
bonobo_ui_node_new ()
Creates a new node with name name
bonobo_ui_node_new_child ()
Create a new node as a child of parent with name name
bonobo_ui_node_copy ()
Copy an XML node, if recursive do a deep copy, otherwise just dup the node itself.
bonobo_ui_node_free ()
Frees the memory associated with the node and unlink it from the tree
bonobo_ui_node_set_data ()
void bonobo_ui_node_set_data (BonoboUINode *node,
gpointer data); |
Associates some user data with the node pointer
bonobo_ui_node_get_data ()
Gets user data associated with node
bonobo_ui_node_set_attr ()
void bonobo_ui_node_set_attr (BonoboUINode *node,
const char *name,
const char *value); |
Set the attribute of name on node to value overriding any
previous values of that attr.
bonobo_ui_node_get_attr ()
char* bonobo_ui_node_get_attr (BonoboUINode *node,
const char *name); |
Fetch the value of an attr of name name from node
see also: bonobo_ui_node_free_string
bonobo_ui_node_has_attr ()
gboolean bonobo_ui_node_has_attr (BonoboUINode *node,
const char *name); |
Determines whether the node has an attribute of name name
bonobo_ui_node_remove_attr ()
void bonobo_ui_node_remove_attr (BonoboUINode *node,
const char *name); |
remove any attribute with name name from node
bonobo_ui_node_add_child ()
Add a child node to the parent node ( after the other children )
bonobo_ui_node_insert_before ()
Insert a sibling before prev_sibling in a node list
bonobo_ui_node_unlink ()
Unlink node from its tree, ie. disassociate it with its parent
bonobo_ui_node_replace ()
Replace old_node with new_node in the tree. old_node is
left unlinked and floating with its children.
bonobo_ui_node_set_content ()
void bonobo_ui_node_set_content (BonoboUINode *node,
const char *content); |
Set the textual content of node to content
bonobo_ui_node_get_content ()
see also: bonobo_ui_node_free_string
bonobo_ui_node_children ()
bonobo_ui_node_get_name ()
bonobo_ui_node_has_name ()
gboolean bonobo_ui_node_has_name (BonoboUINode *node,
const char *name); |
bonobo_ui_node_transparent ()
Determines whether node is transparent. A node is
transparent if it has no content and either no attributes
or a single 'name' attribute.
bonobo_ui_node_copy_attrs ()
This function copies all the attributes from src to dest
effectively cloning the src node as dest
bonobo_ui_node_free_string ()
void bonobo_ui_node_free_string (char *str); |
Frees a string returned by any of the get routines.
bonobo_ui_node_to_string ()
char* bonobo_ui_node_to_string (BonoboUINode *node,
gboolean recurse); |
Convert the Node to its XML string representation
see also: bonobo_ui_node_free_string
bonobo_ui_node_from_string ()
Parses a string into an XML tree
bonobo_ui_node_from_file ()
BonoboUINode* bonobo_ui_node_from_file (const char *filename); |
Loads and parses the filename into an XML tree
bonobo_ui_node_strip ()
This function is used to purge unwanted content from
a set of nodes, and particularly clean up stray Doc and
NS pointers that cause serious trouble later.