Axl Node: Xml node interface functions to use and manipulate xml nodes inside documents.


Defines

#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.
#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.
#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, ' ').
#define HAS_ATTR(node, attr)   axl_node_has_attribute(node,attr)
 Macro definition which works as an alias for axl_node_get_attribute_value.
#define HAS_ATTR_VALUE(node, attr, value)   (axl_node_has_attribute_value (node, attr, value))
 Convenience macro wrapping axl_node_has_attribute_value.
#define NODE_CMP_NAME(node, name)   (axl_cmp ((node != NULL) ? axl_node_get_name(node) : "><", (name != NULL) ? name : "<>"))
 Allows to easily check that the given xml node (axlNode) have the provided name.

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.
bool axl_node_are_equal (axlNode *node, axlNode *node2)
 Allows to check if the provided references represents two equivalent nodes.
char * axl_node_content_copy_and_escape (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 ").
axlNodeaxl_node_copy (axlNode *node, bool copy_attributes, bool copy_childs)
 Allows to perform a copy operation for the provided node.
axlNodeaxl_node_create (const char *name)
 Creates a new axlNode with the provided name.
axlNodeaxl_node_create_ref (char *name)
 Creates a new axlNode but using the memory passed in by the name reference.
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.
bool axl_node_dump (axlNode *node, char **content, int *size)
 Allows to dump the xml content taking as starting point the xml node provided.
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.
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.
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.
axlNodeaxl_node_find_called (axlNode *parent, char *name)
 Allows to find the first child called as provided inside the childs (including its descendants) hold by the parent provided.
void axl_node_free (axlNode *node)
 Destroy the given node provided by the reference.
void axl_node_free_full (axlNode *node, bool also_childs)
 Allows to remove the provided node without removing childs inside it.
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.
char * axl_node_get_attribute_value_copy (axlNode *node, const char *attribute)
 Gets an allocated copy for the value associated to the given attribute.
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.
const char * axl_node_get_attribute_value_trimmed (axlNode *node, const char *attribute)
 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, ' ').
axlNodeaxl_node_get_child_called (axlNode *parent, char *name)
 Allows to get a particular child node for the given node (axlNode).
axlNodeaxl_node_get_child_nth (axlNode *parent, int position)
 Allows to get the child that is located at the given position, for the given parent node.
int axl_node_get_child_num (axlNode *parent)
 Allows to get the number of childs the provided node has.
axlListaxl_node_get_childs (axlNode *node)
 Allows to get childs nodes for the given xml node (axlNode).
const char * axl_node_get_content (axlNode *node, int *content_size)
 Allows to get current xml node content (axlNode).
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.
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.
char * axl_node_get_content_trim (axlNode *node, int *content_size)
 Allows to get the content inside the provided node, trimming the header and trailing white spaces found.
axlDocaxl_node_get_doc (axlNode *node)
 Allows to get the xml document (axlDoc) where the provided xml node is stored.
axlNodeaxl_node_get_first_child (axlNode *node)
 Allows to get the first child that holds the node.
axlNodeaxl_node_get_last_child (axlNode *node)
 Allows to get the last child that holds the node.
const char * axl_node_get_name (axlNode *node)
 Allows to get current xml node name (represented the xml node by axlNode).
axlNodeaxl_node_get_next (axlNode *node)
 Allows to get the node that is located, at the same level, on the next position of the child list.
axlNodeaxl_node_get_next_called (axlNode *node, char *name)
 Allows to get the next node, following to the node provided, matching the given name.
axlNodeaxl_node_get_parent (axlNode *node)
 Allows to get the parent xml node (axlNode) that is holding as child the provided xml node reference.
char * axl_node_get_pi_target_content (axlNode *node, char *pi_target)
 Allows to get current processing instruction content.
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.
axlNodeaxl_node_get_previous (axlNode *node)
 Allows to get the previous reference from the reference node provided.
axlNodeaxl_node_get_previous_called (axlNode *node, char *name)
 Allows to get the previous node, preceding to the node provided, matching the given name.
bool axl_node_has_attribute (axlNode *node, const char *attribute)
 Allows to check if a particular attribute is installed on the given node.
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.
bool axl_node_has_attributes (axlNode *node)
 Allows to check if the provided has any attribute installed.
bool axl_node_has_invalid_chars (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.
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).
bool axl_node_have_childs (axlNode *node)
 Allows to get current childs configuration for the given xml node (axlNode).
bool axl_node_is_empty (axlNode *node)
 Allows to get current emptyness configuration for the given axlNode.
int axl_node_num_attributes (axlNode *node)
 Allows to get the number of attributes installed on the provided node.
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.
axlNodeaxl_node_parse_strings (axlError **error,...)
 This function allows to create a xml node from the provided xml content.
void axl_node_remove (axlNode *node, bool dealloc)
 Allows to the remove the selected reference from the document containing it.
void axl_node_remove_attribute (axlNode *node, const char *attribute)
 Allows to remove the attribute provided, from the node provided.
void axl_node_replace (axlNode *node, axlNode *new_node, bool dealloc)
 Allows to replace a selected node, with the new reference inside its context (updating all references: next, previous and parent).
void axl_node_set_attribute (axlNode *node, const char *attribute, const char *value)
 Allows to configure an xml attribute to the given node.
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.
void axl_node_set_cdata_content (axlNode *node, char *content, int content_size)
 Allows to store data as content of the provided noe to be enclosed as CDATA.
void axl_node_set_child (axlNode *parent, axlNode *child)
 Allows to configure a child node to the given parent.
void axl_node_set_child_after (axlNode *reference, axlNode *child)
 Sets a new child after the node provided as a reference.
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.
void axl_node_set_content (axlNode *node, const char *content, int content_size)
 Allows to set content to the given axlNode instance.
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.
void axl_node_set_have_childs (axlNode *node, bool childs)
 Allows to configure that the given node have child nodes.
void axl_node_set_is_empty (axlNode *node, bool empty)
 Allows to configure the given node to be empty.
void axl_node_set_name (axlNode *node, const char *name)
 Allows to configure the node name, using the value provided.
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.
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.