[xsl] How to capture errors in XSLT transformation?

Subject: [xsl] How to capture errors in XSLT transformation?
From: Esther Parrilla Endrino <esther.parrilla@xxxxxxxxxxxxxxxx>
Date: Thu, 13 Nov 2003 16:37:14 +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