Simple C Expat Wrapper (SCEW)  1.1.7
Files | Functions
Allocation

Allocate and free elements. More...

Files

file  element.h
 SCEW element's handling routines.
 

Functions

SCEW_API scew_elementscew_element_create (XML_Char const *name)
 Creates a new element with the given name. More...
 
SCEW_API scew_elementscew_element_copy (scew_element const *element)
 Makes a deep copy of the given element. More...
 
SCEW_API void scew_element_free (scew_element *element)
 Frees the given element recursively. More...
 

Detailed Description

Allocate and free elements.

Function Documentation

SCEW_API scew_element* scew_element_create ( XML_Char const *  name)

Creates a new element with the given name.

This element is not yet related to any XML tree.

Precondition
name != NULL
Returns
the created element, or NULL if an error is found.
SCEW_API scew_element* scew_element_copy ( scew_element const *  element)

Makes a deep copy of the given element.

Attributes and children elements will be copied. The new element will not belong to any XML tree.

Precondition
element != NULL
Returns
a new element, or NULL if the copy failed.
SCEW_API void scew_element_free ( scew_element element)

Frees the given element recursively.

That is, it frees all its children and attributes. If the element has a parent, it is also detached from it. If a NULL element is given, this function does not have any effect.