#include "xelement.h"
#include "util.h"
#include <string.h>
Functions | |
scew_element * | scew_element_create (XML_Char const *name) |
void | scew_element_free (scew_element *element) |
unsigned int | scew_element_count (scew_element const *parent) |
scew_element * | scew_element_by_index (scew_element const *parent, unsigned int idx) |
scew_element * | scew_element_by_name (scew_element const *parent, XML_Char const *name) |
scew_element ** | scew_element_list (scew_element const *parent, XML_Char const *name, unsigned int *count) |
void | scew_element_list_free (scew_element **list) |
XML_Char const * | scew_element_name (scew_element const *element) |
XML_Char const * | scew_element_contents (scew_element const *element) |
XML_Char const * | scew_element_set_name (scew_element *element, XML_Char const *name) |
XML_Char const * | scew_element_set_contents (scew_element *element, XML_Char const *data) |
scew_element * | scew_element_add (scew_element *element, XML_Char const *name) |
scew_element * | scew_element_add_elem (scew_element *element, scew_element *new_elem) |
void | scew_element_del (scew_element *element) |
void | scew_element_del_by_name (scew_element *element, XML_Char const *name) |
void | scew_element_del_by_index (scew_element *element, unsigned int idx) |
void | scew_element_list_del (scew_element *element, XML_Char const *name) |
scew_attribute * | scew_element_add_attr (scew_element *element, scew_attribute *attribute) |
scew_attribute * | scew_element_add_attr_pair (scew_element *element, XML_Char const *name, XML_Char const *value) |
void | scew_element_del_attr (scew_element *element, XML_Char const *name) |
|
Adds a new child to the given element with the specified name.
|
|
Adds an already existent attribute to the element. If the attribute already exist, the old value will be overwritten. It is important to note that the attribute given will be part of the element's attributes (ownership is lost), so it should not be freed.
|
|
Adds a new attribute to the given element. An attribute is formed by a pair (name, value). Note that if the attribute already exist, the old value will be overwritten.
|
|
Adds an already existent element (
|
|
Returns the child element on the specified position. Positions are zero based.
|
|
Returns the first element child that matches the given name. Remember that XML names are case-sensitive.
|
|
Returns the element contents value. That is the contents between the start and end element tags. Returns NULL if element has no contents. |
|
Returns the number of children of the specified element. An element can have zero or more children. |
|
Creates a new element with the given name. This element is not yet related to any XML tree. |
|
This function is equivalent to
|
|
Deletes an attribute from an element. |
|
Deletes the child element at the specified position. |
|
Deletes the first child of the given element that matches |
|
Frees an element recursively. That is, it frees all his childs and attributes. |
|
Returns a list of elements that matches the name specified. The number of elements is returned in count. The returned pointer must be freed after using it, calling the |
|
Deletes all child elements of the given element that match
|
|
Frees an element list created by |
|
Returns the element name or NULL if the element does not exist. |
|
Sets the new contents to the given element and frees the old one.
|
|
Sets a new name to the given element and frees the old one.
|