[xslt] xsltSaveResultTo & xsltSaveResultToFile



Hello there,

here's a (simple) sample of my code:

  xml_result_file = xsltApplyStylesheet (xslt_stylesheet, record_xml_file,
NULL);
  if (xml_result_file != NULL)
  {
    printf("xml_result_file != NULL\n");

    save_result = xsltSaveResultTo (xml_output_buffer, xml_result_file,
xslt_stylesheet);
    if (save_result == -1)
    {
      printf ("Result file not saved to buffer\n");
    }
    else
    {
      printf("Result successfully saved to buffer\n");
    }

    output_file = fopen ("./output.html", "ab");
    if (output_file != NULL)
    {
      save_result = xsltSaveResultToFile (xml_output_buffer,
xml_result_file, xslt_stylesheet);
      if (save_result == -1)
      {
        printf ("Result not saved in HTML-file\n");
      }
      else
      {
        printf("Result successfully saved in HTML-file\n");
      }
    }
  }
  else
  {
    printf("xml_result_file == NULL\n");
  }

and this is the output on screen:

XSLT-doc loaded successfully
XML-doc loaded successfully
xml_result_file != NULL
Result file not saved to buffer
Result not saved in HTML-file


As you can see my xml_result_file != NULL, which means something
xsltApplyStylesheet did produce output.  I tested mys stylesheet and
xml-file using the command-line tool xsltproc.  This seems to work
perfectly.  Therefore I think the problem of not saving any output, neither
to the buffer or a file, lies in the save-funtionc I used (xsltSaveResultTo
& xsltSaveResultToFile).  Can anybody tell me what's happening (or not)
here?

THX,
kris





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