Re: [xslt] saving output of xsltApplyStyleSheet ???
- From: robert <robert xsl 00008 org>
- To: xslt gnome org
- Subject: Re: [xslt] saving output of xsltApplyStyleSheet ???
- Date: Fri, 11 Jan 2002 10:47:55 +0100
>I want to assign the result of "xsltApplyStylesheet" to the parameter
>char *result.
I use the following code (ERRORCHK, CLEANUP and STRING are macro's):
xsltres = xsltApplyStylesheet(xss, xmldoc, params);
if (xsltres == NULL)
{
ERRORCHK("XSL apply error");
CLEANUP;
return 0;
}
ERRORCHK("XSL apply warning");
/* save result */
{
xmlOutputBufferPtr buf;
xmlCharEncodingHandlerPtr enc = NULL;
char *xmlIOContext = NULL;
/* check for supplied output-encoding */
if (encoding != NULL)
enc = xmlGetCharEncodingHandler(xmlParseCharEncoding(encoding));
buf = xmlOutputBufferCreateIO(xmlIOWrite, xmlIOClose, &xmlIOContext, enc);
if (buf == NULL)
{
CLEANUP;
return 0;
}
if (xsltSaveResultTo(buf, xsltres, xss) == -1)
{
CLEANUP;
return 0;
}
xmlOutputBufferClose(buf);
/* xmlIOContext is result-buffer */
STRING(xmlIOContext);
}
You can replace xmlIOContext with 'result' in your code.
robert
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]