axl main logo
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Modules Pages
Macros | Functions
Axl Node: Xml node interface functions to use and manipulate xml nodes inside documents.

Macros

#define ATTR_VALUE(node, attr)   axl_node_get_attribute_value(node, attr)
 Macro definition, which works as an alias for axl_node_get_attribute_value. More...
 
#define ATTR_VALUE_TRANS(node, attr)   axl_node_get_attribute_value_trans(node,attr)
 Simple alias definition to axl_node_get_attribute_value_trans function. More...
 
#define ATTR_VALUE_TRIMMED(node, attr)   axl_node_get_attribute_value_trimmed(node,attr)
 Allows to get the value associated to the attributed provided, inside the node selected, removing trailing and ending white spaces (in the W3C sence: \n, \t, \r, ' '). More...
 
#define HAS_ATTR(node, attr)   axl_node_has_attribute(node,attr)
 Macro definition which works as an alias for axl_node_get_attribute_value. More...
 
#define HAS_ATTR_VALUE(node, attr, value)   (axl_node_has_attribute_value (node, attr, value))
 Convenience macro wrapping axl_node_has_attribute_value. More...
 
#define NODE_CMP_NAME(node, name)   (axl_cmp ((node) ? axl_node_get_name(node) : "><", (name) ? (name) : "<>"))
 Allows to easily check that the given xml node (axlNode) have the provided name. More...
 

Functions

void axl_node_add_pi_target (axlNode *node, char *target, char *content)
 Allows to associate a PI element, including its content to the provided node. More...
 
axl_bool axl_node_are_equal (axlNode *node, axlNode *node2)
 Allows to check if the provided references represents two equivalent nodes. More...
 
axl_bool axl_node_are_equal_full (axlNode *node, axlNode *node2, axlError **error)
 Allows to check if the provided references represents two equivalent nodes. More...
 
char * axl_node_content_copy_and_escape (const char *content, int content_size, int additional_size)
 Allows to perform a copy from the content provided, doing an xml character escaping for non allowed values (&, <, >, ' and "). More...
 
char * axl_node_content_copy_and_escape_cdata (const char *content, int content_size, int additional_size)
 Allows to perform a copy for the content provided, doing an xml character escaping for non allowed values (&, <, >, ' and ") taking into consideration the content will be placed inside a <![CDATA[..]]> declaration. More...
 
char * axl_node_content_translate_defaults (char *content, int *content_size)
 Replaces all entity references to its corresponding values. More...
 
axlNodeaxl_node_copy (axlNode *node, axl_bool copy_attributes, axl_bool copy_childs)
 Allows to perform a copy operation for the provided node. More...
 
axlNodeaxl_node_create (const char *name)
 Creates a new axlNode with the provided name. More...
 
axlNodeaxl_node_create_ref (char *name)
 Creates a new axlNode but reusing the memory passed in by the name reference. More...
 
void axl_node_deattach (axlNode *node)
 Supposing the node is attached to a xml document (axlDoc), this function allows to deattach the node from the document that is holding it. More...
 
axl_bool axl_node_dump (axlNode *node, char **content, int *size)
 Allows to dump the xml content taking as starting point the xml node provided. More...
 
axl_bool axl_node_dump_pretty (axlNode *node, char **content, int *size, int tabular)
 Allows to perform a pretty print operation using as reference (starting point) the node provided. More...
 
axl_bool axl_node_dump_pretty_to_file (axlNode *node, char *file_path, int tabular)
 Allows to pretty print dump the xml document using as reference the node provided, at the file path provided. More...
 
axl_bool axl_node_dump_to_file (axlNode *node, char *file_path)
 Allows to dump the xml document using as reference the node provided, at the file path provided. More...
 
axlNodeaxl_node_find_called (axlNode *parent, const char *name)
 Allows to find the first child called name, inside all childs (including its descendants) held by the parent provided. More...
 
void axl_node_free (axlNode *node)
 Destroy the given node provided by the reference. More...
 
void axl_node_free_full (axlNode *node, axl_bool also_childs)
 Allows to remove the provided node, optionally without removing childs inside it. More...
 
const char * axl_node_get_attribute_value (axlNode *node, const char *attribute)
 Allows to get current content of the provided attribute inside the given node. More...
 
char * axl_node_get_attribute_value_copy (axlNode *node, const char *attribute)
 Gets an allocated copy for the value associated to the given attribute. More...
 
char * axl_node_get_attribute_value_trans (axlNode *node, const char *attribute)
 Gets the attribute content for the provided attribute name, at the provided node, but translating entity references found. More...
 
const char * axl_node_get_attribute_value_trimmed (axlNode *node, const char *attribute)
 Allows to get the value associated to the attribute provided, inside the node selected, removing trailing and ending white spaces (in the W3C sence: \n, \t, \r, ' '). More...
 
axlNodeaxl_node_get_child_called (axlNode *parent, const char *name)
 Allows to get a particular child node from the given node (axlNode). More...
 
axlNodeaxl_node_get_child_nth (axlNode *parent, int position)
 Allows to get the child that is located at the given position, inside the given parent node. More...
 
int axl_node_get_child_num (axlNode *parent)
 Allows to get the number of childs that the provided node has. More...
 
axlListaxl_node_get_childs (axlNode *node)
 Allows to get childs nodes from the given xml node (axlNode). More...
 
const char * axl_node_get_content (axlNode *node, int *content_size)
 Allows to get current xml node content (axlNode). More...
 
char * axl_node_get_content_copy (axlNode *node, int *content_size)
 Allows to get a copy for the content stored inside the given axlNode reference. More...
 
char * axl_node_get_content_trans (axlNode *node, int *content_size)
 Allows to the get node content, performing a memory allocation for the returned result, translating default entities values with its replacement text. More...
 
const char * axl_node_get_content_trim (axlNode *node, int *content_size)
 Allows to get the content inside the provided node, trimming the head and trailing white spaces found. More...
 
axlDocaxl_node_get_doc (axlNode *node)
 Allows to get the xml document (axlDoc) where the provided xml node is stored. More...
 
axlNodeaxl_node_get_first_child (axlNode *node)
 Allows to get the first child that holds the node. More...
 
axlNodeaxl_node_get_last_child (axlNode *node)
 Allows to get the last child that holds the node. More...
 
const char * axl_node_get_name (axlNode *node)
 Allows to get current xml node name. More...
 
axlNodeaxl_node_get_next (axlNode *node)
 Allows to get the node that is located, at the same level, on the next position on the child list. More...
 
axlNodeaxl_node_get_next_called (axlNode *node, const char *name)
 Allows to get the next node, following to the node provided, matching the given name. More...
 
axlNodeaxl_node_get_parent (axlNode *node)
 Allows to get the parent xml node (axlNode) of the provided xml node reference. More...
 
char * axl_node_get_pi_target_content (axlNode *node, char *pi_target)
 Allows to get current processing instruction content. More...
 
axlListaxl_node_get_pi_target_list (axlNode *node)
 Allows to get a list which contains axlPI nodes, representing all process instruction that the axlNode (xml document node) has. More...
 
axlNodeaxl_node_get_previous (axlNode *node)
 Allows to get the previous reference relative to the node reference provided. More...
 
axlNodeaxl_node_get_previous_called (axlNode *node, const char *name)
 Allows to get the previous node, preceding to the node provided, matching the given name. More...
 
axl_bool axl_node_has_attribute (axlNode *node, const char *attribute)
 Allows to check if a particular attribute is installed on the given node. More...
 
axl_bool axl_node_has_attribute_value (axlNode *node, const char *attribute, const char *value)
 Convenience function that allows to check if a particular attribute with a particular value is found at the provided node. More...
 
axl_bool axl_node_has_attributes (axlNode *node)
 Allows to check if the provided node has attributes installed. More...
 
axl_bool axl_node_has_invalid_chars (const char *content, int content_size, int *added_size)
 Allows to check if the provided string have invalid chars that must be escaped by using the entity reference rather the value itself. More...
 
axl_bool axl_node_has_invalid_chars_cdata (const char *content, int content_size, int *added_size)
 Allows to check if the provided string have escape sequences that must be defined by using the entity reference rather the value itself, taking into consideration the content will be used for a <![CDATA[..]]> section. More...
 
axl_bool axl_node_has_pi_target (axlNode *node, char *pi_target)
 Allows to check if the provided Processing instruction target is defined on the given xml node document (axlNode). More...
 
axl_bool axl_node_have_childs (axlNode *node)
 Allows to get current childs configuration from the given xml node (axlNode). More...
 
axl_bool axl_node_is_empty (axlNode *node)
 Allows to check if the provided axlNode is empty. More...
 
int axl_node_num_attributes (axlNode *node)
 Allows to get the number of attributes installed on the provided node. More...
 
axlNodeaxl_node_parse (axlError **error, const char *content,...)
 Allows to create a complete node configuring not only the node but its content, using a printf-like format. More...
 
axlNodeaxl_node_parse_strings (axlError **error,...)
 This function allows to create a xml node from the provided xml content (bootstraping XML content). More...
 
void axl_node_remove (axlNode *node, axl_bool dealloc)
 Allows to remove the selected reference from the document containing it. More...
 
void axl_node_remove_attribute (axlNode *node, const char *attribute)
 Allows to remove the provided attribute, from the node provided. More...
 
void axl_node_replace (axlNode *node, axlNode *new_node, axl_bool dealloc)
 Allows to replace a selected node with a new reference inside its context (updating all references: next, previous and parent). More...
 
void axl_node_set_attribute (axlNode *node, const char *attribute, const char *value)
 Allows to configure an xml attribute on the given node. More...
 
void axl_node_set_attribute_ref (axlNode *node, char *attribute, char *value)
 Allows to install a new attribute pair, based on the attribute name and the attribute value, without allocating memory for them. More...
 
void axl_node_set_cdata_content (axlNode *node, const char *content, int content_size)
 Allows to store CDATA enclosed content on the provided node. More...
 
void axl_node_set_child (axlNode *parent, axlNode *child)
 Allows to configure a child node to the given parent. More...
 
void axl_node_set_child_after (axlNode *reference, axlNode *child)
 Sets a new child after the node provided, using it as a reference. More...
 
void axl_node_set_comment (axlNode *node, char *comment, int comment_size)
 Allows to configure a new comment (<!– xml comment –>) that will be stored as a child for the node provided. More...
 
void axl_node_set_content (axlNode *node, const char *content, int content_size)
 Allows to set content to the given axlNode instance. More...
 
void axl_node_set_content_ref (axlNode *node, char *content, int content_size)
 Set the content for the provided node, reusing the reference provided, without making a local copy. More...
 
void axl_node_set_have_childs (axlNode *node, axl_bool childs)
 Allows to configure that the given node have child nodes. More...
 
void axl_node_set_is_empty (axlNode *node, axl_bool empty)
 Allows to configure the given node to be empty. More...
 
void axl_node_set_name (axlNode *node, const char *name)
 Allows to configure the node name, using the value provided. More...
 
void axl_node_set_name_ref (axlNode *node, char *name)
 Allows to configure the node name, using the value provided as a reference allocated and to be owned by the node. More...
 
void axl_node_transfer_childs (axlNode *old_parent, axlNode *new_parent)
 Allows to transfer (move from) all childs (including comments, content, PI, nodes, etc) from the old parent to the new parent. More...
 

Detailed Description