Re: [xslt] XsltSaveResultFileToMemoryBuffer() ?



This is an excerpt from my code which does something similar
based on xsltproc.c using xsltSaveResultTo:

    outputBuffer = xmlAllocOutputBuffer(NULL);
	if (outputBuffer == NULL) {
	    fprintf(stderr, "xmlAllocOutputBuffer failed\n");
        return;
	}

    count = xsltSaveResultTo(outputBuffer, res, cur);
    if (count < 0) {
	    fprintf(stderr, "xmlSaveResultTo failed\n");
        return;
    }
    //  Add null byte to end.
    nBytes = xmlOutputBufferWrite(outputBuffer, 1, "");
    if (nBytes < 0) {
	    fprintf(stderr, "xmlOutputBufferWrite failed\n");
        return;
    }
    resultString = (char *) outputBuffer->buffer->content;
    fprintf(stdout,"From output buffer:\ny%s\n", resultString);


On Fri, 27 Jul 2001, Heiko Rupp wrote:

> Hello,
> 
> while can read XML files from memory
> 
> with xmlCreateMemoryParserCtxt(), it looks like the
> oposite function is missing. I can do this "by hand",
> but wouldn't it be good to have the equivalent
> of xsltSaveFileResultToFile(), which uses a (predefined)
> memory area as its target?
> 
> Or what am I missing?
> 
>   Heiko
> 
> 
> 
> _______________________________________________
> xslt mailing list
> xslt@gnome.org
> http://mail.gnome.org/mailman/listinfo/xslt
> 





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