|
Check if XSLT Transformation failed
// Load XSL template
$xsl = newDOMDocument;
$xsl->load('stylesheet.xsl');
// Create new XSLTProcessor
$xslt = new XSLTProcessor();
// Load stylesheet
$xslt->importStylesheet($xsl);
// Load XML input file
$xml = new DOMDocument;
$xml->load('data.xml');
// Transform to string
$results = $xslt->transformToXML($xml);
// Transform to a file
$results = $xslt->transformToURI($xml, 'results.txt');
// Transform to DOM object
$results = $xslt->transformToDoc($xml);
if (false === ($results = $xslt->transformToXML($xml))) {
// an error occurred
}
Related Tutorials & Code Snippets
|
|
Latest Tutorials & Code Snippets
|
|
|