[xslt] Exit code of xsltproc



Hello,
I'm using xsltproc to transform XML document. To do this batchwise, I need to be able to detect whether the transformation was successful or not. Unfortunately, xsltproc seems to return 0 as well in the case of errors in the xslt-script where I think an error code should be returned:
- If I just write some dummy text into the xslt-file, I get a compilation error (misplaced text element), but the exit code is 0
- If pass an invalid value to the terminate attribute of xsl:message, I get an error message (xsl: message : terminate expecting 'yes' or 'no'), but the exit code is 0
- On the other hand, other compilation errors (Opening and ending tag mismatch) seem to produce an exit code 9
Is this behaviour by design or is just a bug?
 
Additionally, I would like to use xsl:message with the terminate=no to write warnings (and continue processing) and terminate=yes to write errors (and stop processing). As xsl:message writes to stderr, this should work fine. Unfortunately, an exit code of 0 is returned, even if the processing was stopped by a xsl:message instruction with terminate=yes. Wouldn't it be useful if an exit code other than 0 would be returned, if the processing was terminated that way (and only parts of the output document have already been created)?
 
Thomas


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