Example #1
0
void xdb_file_startElement(void* arg, const char* name, const char** atts)
{
    xf_parse xfp = (xf_parse)arg;

    if (xfp->current == NULL)
    {
	  xfp->current = xmlnode_new_tag_pool(xfp->p, name);
	  xmlnode_put_expat_attribs(xfp->current, atts);
    }
    else
    {
	  xfp->current = xmlnode_insert_tag(xfp->current, name);
	  xmlnode_put_expat_attribs(xfp->current, atts);
    }
}
Example #2
0
void expat_startElement(void* userdata, const char* name, const char** atts)
{
    /* get the xmlnode pointed to by the userdata */
    xmlnode *x = userdata;
    xmlnode current = *x;

    if (current == NULL)
    {
        /* allocate a base node */
        current = xmlnode_new_tag(name);
        xmlnode_put_expat_attribs(current, atts);
        *x = current;
    }
    else
    {
        *x = xmlnode_insert_tag(current, name);
        xmlnode_put_expat_attribs(*x, atts);
    }
}