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

[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
 
<?xml version="1.0" encoding="UTF-8"?>
<artist name="Britney Spears"/>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">
	<xsl:output method="html" indent="yes" version="4.0"/>
	<xsl:template match="/">
	<html>
			<head>
				<title>Test Page</title>
            </head>
            <body>
                 <h2>Artist Detail</h2>
                 Artist: <xsl:value-of select="artist/@name"/>
            </body>
        </html>
    </xsl:template>
</xsl:stylesheet>


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