pentaho/pentaho-kettle · error · KettleStepException
XSLT01
XSLT01
Error message
Xslt.ErrorProcesing
What it means
Generic wrapping error thrown when the XSLT step fails to process a row's transformation. If the step meta has error handling configured, the row is routed to the error stream via putError with code XSLT01; otherwise the step logs and rethrows a KettleStepException wrapping the original exception. It covers XML parsing, TransformerFactory, and output-conversion failures.
Solutions
- Read the wrapped cause ('Caused by') to identify the real failure; enable error handling on the step to route bad rows instead of aborting
- Validate the XML field content (well-formed, correct encoding) before the XSLT step
- Verify the stylesheet compiles with the JVM's default XSLT processor version; simplify output properties if misconfigured
Example fix
// before throw new KettleStepException( BaseMessages.getString( PKG, "Xslt.ErrorProcesing" ), e ); // after // configure step error handling so bad rows go to the error stream: // putError( getInputRowMeta(), row, 1, errorMessage, meta.getResultfieldname(), "XSLT01" );
Defensive patterns
Strategy: try-catch
Validate before calling
// Validate XML and stylesheet before transforming DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(xmlField))); TransformerFactory.newInstance().newTransformer(new StreamSource(new File(xslFilename)));
Try / catch
try {
transformation.execute(...);
} catch (KettleStepException e) {
Throwable cause = e.getCause();
log.error("XSLT processing failed: " + (cause != null ? cause : e.getMessage()));
// route row to error handling / quarantine
} Prevention
- Configure step error handling so failing rows go to the error stream instead of aborting
- Validate XML field content upstream (well-formedness, encoding)
- Test the stylesheet against the JVM's XSLT processor version before production
When it happens
Trigger: Any Exception while transforming a row: malformed XML in the XML field, XSLT stylesheet compile errors, invalid result type conversion, or Transformer configuration (output properties) problems.
Common situations: Field contains XML with encoding issues or invalid characters; stylesheet references non-existent functions (e.g. XSLT 2.0 features on an XSLT 1.0 processor); result field name/type mismatch; JVM lacking a suitable TransformerFactory.
Related errors
- ColumnExists.Log.ErrorInStep
- Errors encountered (first 10): ...
- FixedTimeStreamWindow.SubtransFailed
- MAIL001
- TableExists.Log.ErrorInStep
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/d057f72061ffbba8.
Report an issue: GitHub.
Appendix: source
Thrown at plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/xslt/Xslt.java:262
}
Object[] outputRowData = RowDataUtil.addValueData( row, getInputRowMeta().size(), xmlString );
if ( log.isRowLevel() ) {
logRowlevel( BaseMessages.getString( PKG, "Xslt.Log.ReadRow" ) + " " + getInputRowMeta().getString( row ) );
}
// add new values to the row.
putRow( data.outputRowMeta, outputRowData ); // copy row to output rowset(s);
} catch ( Exception e ) {
String errorMessage = e.getClass().toString() + ": " + e.getMessage();
if ( getStepMeta().isDoingErrorHandling() ) {
// Simply add this row to the error row
putError( getInputRowMeta(), row, 1, errorMessage, meta.getResultfieldname(), "XSLT01" );
} else {
logError( BaseMessages.getString( PKG, "Xslt.ErrorProcesing" + " : " + errorMessage ), e );
throw new KettleStepException( BaseMessages.getString( PKG, "Xslt.ErrorProcesing" ), e );
}
}
return true;
}
public boolean init( StepMetaInterface smi, StepDataInterface sdi ) {
meta = (XsltMeta) smi;
data = (XsltData) sdi;
if ( super.init( smi, sdi ) ) {
// Specify weither or not we have to deal with XSL filename
data.xslIsAfile = ( meta.useXSLField() && meta.isXSLFieldIsAFile() ) || ( !meta.useXSLField() );
// Add init code here.
return true;
}
return false;
}
View on GitHub (pinned to f3058517a1)