/xmlbench/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/xmlbench/trunk

« back to all changes in this revision

Viewing changes to xsl/libxml.c

  • Committer: Suren A. Chilingaryan
  • Date: 2009-09-23 17:13:04 UTC
  • Revision ID: csa@dside.dyndns.org-20090923171304-osvtr4zqb29h11kd
Intel, Tango, Phobos, and RapidXML parsers; Memory benchmark scripts

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
void releaseXML(struct TestData *td) {
25
25
    xsltFreeStylesheet(xsl);
26
26
//    xmlFreeDoc(xsldoc);
27
 
    xmlFreeDoc(doc);    
 
27
    if (doc) {
 
28
        xmlFreeDoc(doc);    
 
29
        doc = NULL;
 
30
    }
28
31
    xmlCleanupParser();
29
32
}
30
33
 
38
41
    if (doc) {
39
42
        xmlFreeDoc(doc);    
40
43
    }
 
44
 
41
45
    doc=xmlParseMemory(td->xml,td->xmllen);
42
46
    if (!doc) {
43
47
        printf("Error parsing document!\n");
51
55
    xmlDocPtr res=0;
52
56
    const char * params[1] = { NULL };
53
57
 
 
58
    xmlBufferPtr buf;
 
59
    xmlOutputBufferPtr iobuf;
 
60
    
 
61
    buf = xmlBufferCreate();
 
62
    iobuf = xmlOutputBufferCreateBuffer(buf, NULL);
 
63
    xsltRunStylesheet(xsl, doc, params, NULL, NULL, iobuf);
 
64
    //if (iter==td->iterations) puts(buf->content);
 
65
    free(iobuf);
 
66
    xmlBufferFree(buf);
 
67
    
 
68
 
 
69
/*
54
70
    res=xsltApplyStylesheet(xsl,doc,params);
55
 
 
56
 
/*
57
 
    if (iter==td->iterations) {
58
 
        xmlDocDumpMemory(res,&mem,&memsize);
59
 
        puts(mem);
60
 
        free(mem);
61
 
    }
 
71
    xmlDocDumpMemory(res,&mem,&memsize);
 
72
    //if (iter==td->iterations) puts(buf->content);
 
73
    free(mem);
 
74
    xmlFreeDoc(res);
62
75
*/
63
 
    xmlFreeDoc(res);
64
76
}
65
77
 
66
78
int main(int argc, char *argv[]) {