[xslt] Transformation



Hello all,

I'm applying a stylesheet to an XML document using the following code snippet:
//==============================
// Parsing the XML document
doc = xmlParseFile(argv[0]);
if(doc == NULL)
    return (-1);
cur = xsltLoadStylesheetPI(doc);
if(cur != NULL)
{
    printf("Embedded Stylesheet\n");
}
else
{
    i++;
    cur = xsltParseStylesheetFile((const xmlChar *)argv[1]);
}
res = xsltApplyStylesheet(cur, doc, params);
xsltSaveResultToFilename("Output.html", res, cur, 0);
//==============================

I wanted to know whether this code is correct for all possible cases of
transformation OR
Am I missing something?

Thanks,
Raghunath


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