Actions
Bug #2677
closedSaxon/C PHP API getErrorMessage does not report useful error
Start date:
2016-03-15
Due date:
% Done:
100%
Estimated time:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Found in version:
1.0.0
Fixed in version:
1.0.1
SaxonC Languages:
SaxonC Platforms:
SaxonC Architecture:
Description
I am not sure if this is a bug, but if not it's a feature request :-)
When the XSLT compilation fails (for example on the XSL error I considered as bug here https://saxonica.plan.io/issues/2676) I don't get any useful information from getErrorMessage().
The code
$result = $saxon->transformToString();
if($result == NULL) {
$errCount = $saxon->getExceptionCount();
if($errCount > 0 ){
for($i = 0; $i < $errCount; $i++) {
$errCode = $saxon->getErrorCode(intval($i));
$errMessage = $saxon->getErrorMessage(intval($i));
echo 'Error: Code='.$errCode.' Message='.$errMessage;
}
$saxon->exceptionClear();
}
}
gives the error
Error: Code=Unknown Message=net.sf.saxon.s9api.SaxonApiException : Stylesheet compilation failed: 1 error reported
in the /var/log/apache2/error.log a more useful error appears:
Error at xsl:call-template on line 11 column 37 of style.xml: XTSE0680: Parameter xxx is not declared in the called template
Is it possible to make the getErrorMessage() function retrieve this error code?
Please register to edit this issue
Actions