Simple C Expat Wrapper (SCEW)  1.1.7
Files | Functions
Search and iteration

Iterate and search for elements. More...

Files

file  element.h
 SCEW element's handling routines.
 

Functions

SCEW_API scew_elementscew_element_by_name (scew_element const *element, XML_Char const *name)
 Returns the first child from the specified element that matches the given name. More...
 
SCEW_API scew_elementscew_element_by_index (scew_element const *element, unsigned int index)
 Returns the child of the given element at the specified zero-based index. More...
 
SCEW_API scew_listscew_element_list_by_name (scew_element const *element, XML_Char const *name)
 Returns a list of children from the specified element that matches the given name. More...
 

Detailed Description

Iterate and search for elements.

Function Documentation

SCEW_API scew_element* scew_element_by_name ( scew_element const *  element,
XML_Char const *  name 
)

Returns the first child from the specified element that matches the given name.

Remember that XML names are case-sensitive.

Precondition
element != NULL
name != NULL
Returns
the first child that matches the given name, or NULL if not found.
SCEW_API scew_element* scew_element_by_index ( scew_element const *  element,
unsigned int  index 
)

Returns the child of the given element at the specified zero-based index.

Precondition
element != NULL
index < scew_element_count
Returns
the child at the specified position, or NULL if there are no children elements.
SCEW_API scew_list* scew_element_list_by_name ( scew_element const *  element,
XML_Char const *  name 
)

Returns a list of children from the specified element that matches the given name.

This list must be freed after using it via scew_list_free (the elements will not be freed, only the list pointing to them).

Precondition
element != NULL
name != NULL
Returns
a list of elements that matches the name specified, or NULL if no element is found.