[xsl] [xslt] How to handle errors using libxslt?

Subject: [xsl] [xslt] How to handle errors using libxslt?
From: Esther Parrilla Endrino <esther.parrilla@xxxxxxxxxxxxxxxx>
Date: Mon, 17 Nov 2003 09:52:25 +0100
Hello all,

I am using the example posted in the libxslt web page to transform an input XML file into HTML, my code is very simple:

-snip-

    // parse XSL
    cur = xsltParseStylesheetFile((const xmlChar *)xslFile_name);

    // parse XML
    doc = xmlParseFile(xmlFile_name);

    // apply XSL
    res = xsltApplyStylesheet(cur, doc, params);

    // display in stdout
    //xsltSaveResultToFile(stdout, res, cur);

    // saves formatted file to disk
    xmlSaveFile(formattedFile_name, res);

    // deallocate
    xsltFreeStylesheet(cur);
    xmlFreeDoc(res);
    xmlFreeDoc(doc);
        xsltCleanupGlobals();
        xmlCleanupParser();


-snip-


If for example, the XML is validated against a schema that contains namespaces and into the XSL I delete the reference to that Namespace location, the file is transformed but erroneously and I get this error onto the console...
How can I catch the error in my code? How are managed erros in thei library?
THefucntions I call does not rerun an error code I can catch and manage!


Any help shall be appreciated

esther
--

~ Code matters more than comercials ~

--


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread