[xml] Problem in xsltSaveResultToFile



Hi All
 
I am getting the problem in the statement            int iWri = xsltSaveResultToFile(stdout, res, cur);
 
It is getting crashed. I am compiling and running the program in VC++ 6.0
 
I tried a lot to solve the problem but i m not getting why it is crashing...???
the xslt and xml file which i m using is attached in this mail...
 
Pls help me....
 
 
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <libxml/xmlmemory.h>
#include <libxml/debugXML.h>
#include <libxml/HTMLtree.h>
#include <libxml/xmlIO.h>
#include <libxml/DOCBparser.h>
#include <libxml/xinclude.h>
#include <libxml/catalog.h>
#include <libxslt/xslt.h>
#include <libxslt/xsltInternals.h>
#include <libxslt/transform.h>
#include <libxslt/xsltutils.h>
 
extern int xmlLoadExtDtdDefaultValue;
 
int main() {
 
 const char *params[16 + 1];
 int nbparams = 0;
 xsltStylesheetPtr cur = NULL;
 xmlDocPtr doc, res;
 
 params[nbparams++] = "rootid";
 params[nbparams++] = "'asect1'";
 params[nbparams] = NULL;
 xmlSubstituteEntitiesDefault(1);
 xmlLoadExtDtdDefaultValue = 1;
 cur = xsltParseStylesheetFile((const xmlChar *)"C:\\Arvind\\XSLT\\Data File\\Test.xsl");
 doc = xmlParseFile("C:\\Arvind\\XSLT\\Data File\\Test.xml");
 res = xsltApplyStylesheet(cur, doc, params);
 int iWri = xsltSaveResultToFile(stdout, res, cur);
 
 xsltFreeStylesheet(cur);
 xmlFreeDoc(res);
 xmlFreeDoc(doc);
 
    xsltCleanupGlobals();
    xmlCleanupParser();
 return(0);
 
}
 
 
Thanks
Arvind
 

Attachment: test.xml
Description: Text Data

Attachment: test.xsl
Description: Text Data



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