Main Page | Alphabetical List | Compound List | File List | Compound Members | File Members

LXMLelement_callbacks_s Struct Reference

#include <lxml.h>

List of all members.

Public Attributes

char * element_name
 The name of the element.

int(* callback )(cntree *atree, void **data, void **data_iter, int op)
 Callback function.

void ** data
 User provided data passed to the callback function.


Detailed Description

Structure containing the function callbacks used to convert between tree structure and application specific data. When converting from tree structure to application specific data, for each element on the same depth matching 'element_name', the 'callback' function is called with the provided 'data'. That callback is responsible to create the application specific data and link it to the supplied 'data'. When converting from application specific data to tree structure, whenever 'data' and '*data' are not NULL, a tree node (element of the XML file) is created with the corresponding 'element_name' and 'callback' is called with the provided 'data' argument and '*data_iter' initially set to NULL. The 'callback' is called again and again (with a newly created element as its first argument) as long as it returns 0 and '*data_iter' is non NULL. This allows the 'callback' function to iterate through application specific data using the '*data_iter' iterator that it uses at its convenience. When 'callback' does not need to be called again, it sets '*data_iter' to NULL, meaning that at this depth, no more elements 'element_name' are to be created. After each successful 'callback' return, the created element is added to the list of children of its parent element.


Member Data Documentation

int(* LXMLelement_callbacks_s::callback)(cntree *atree, void **data, void **data_iter, int op)
 

Callback function.

void** LXMLelement_callbacks_s::data
 

User provided data passed to the callback function.

char* LXMLelement_callbacks_s::element_name
 

The name of the element.


The documentation for this struct was generated from the following file:
Generated on Wed Oct 22 15:57:22 2003 for XetPan by doxygen 1.3.2