[xml] How to parse xml with out



Hi,

I have the following procedure to parse an xml-doc as file:

int streamFile(char *filename) {
    xmlTextReaderPtr reader;
    int ret;

    reader = xmlNewTextReaderFilename(filename);
    if (reader != NULL) {
        ret = xmlTextReaderRead(reader);
        while (ret == 1) {
            processNode(reader);
            ret = xmlTextReaderRead(reader);
        }
        xmlFreeTextReader(reader);
        if (ret != 0) {
            return 1;
        }
    return 0;
    } else {
       return 2;
    }
}

like in the doc from xmlreader interface.

But I produce the xml by applaing an xsl stylesheet:

// transformation
res = xsltApplyStylesheet(cur, doc, NULL);

So my result lies in res. How can I stream this just like with 
xmlNewTextReader?

Thanx in advance

Matthias




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]