pentaho/pentaho-kettle · error · KettleStepException

Xslt.Exception.ErrorXSLFileFieldFinding

Error message

Xslt.Exception.ErrorXSLFileFieldFinding

What it means

The XSL stylesheet is supplied via a field, but that field name does not exist in the incoming row stream. processRow computes data.fielxslfiledposition via indexOfValue(meta.getXSLFileField()) and, if it is < 0, logs 'ErrorXSLFileFieldFinding' and throws this KettleStepException with the field name.

Solutions

  1. Verify the exact field name output by the previous step and correct 'XSL fieldname' (case-sensitive).
  2. Re-run 'Get fields' in the dialog after upstream changes.
  3. Add a step to restore/pass through the XSL path field.

Example fix

// before
XSL fieldname: StylesheetPath
// after (upstream field: stylesheet_path)
XSL fieldname: stylesheet_path
Defensive patterns

Strategy: validation

Validate before calling

String f = meta.getXSLFileField(); if (f != null && previousRowMeta.indexOfValue(f) < 0) { throw new IllegalArgumentException("XSL field '" + f + "' not found in incoming stream"); }

Try / catch

try { step.startThreads(); } catch (KettleStepException e) { if (e.getMessage().contains("ErrorXSLFileFieldFinding")) { /* correct the XSL fieldname to an existing upstream field */ } }

Prevention

When it happens

Trigger: useXSLField() is true, the XSLFileField name is non-empty, but indexOfValue returns -1 on the first incoming row.

Common situations: Upstream step renamed/dropped the XSL path field; case mismatch; Select values step removes the field; transformation edited so the field-producing step is bypassed.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/073e0185b3b3b58b. Report an issue: GitHub.

Appendix: source

Thrown at plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/xslt/Xslt.java:120

      // Check if the XSL Filename is contained in a column
      if ( meta.useXSLField() ) {
        if ( Utils.isEmpty( meta.getXSLFileField() ) ) {
          // The field is missing
          // Result field is missing !
          logError( BaseMessages.getString( PKG, "Xslt.Log.ErrorXSLFileFieldMissing" ) );
          throw new KettleStepException( BaseMessages.getString( PKG, "Xslt.Exception.ErrorXSLFileFieldMissing" ) );
        }

        // Try to get Field index
        data.fielxslfiledposition = getInputRowMeta().indexOfValue( meta.getXSLFileField() );

        // Let's check the Field
        if ( data.fielxslfiledposition < 0 ) {
          // The field is unreachable !
          logError( BaseMessages.getString( PKG, "Xslt.Log.ErrorXSLFileFieldFinding" ) + "[" + meta.getXSLFileField()
              + "]" );
          throw new KettleStepException( BaseMessages.getString( PKG, "Xslt.Exception.ErrorXSLFileFieldFinding", meta
              .getXSLFileField() ) );
        }

      } else {
        if ( Utils.isEmpty( meta.getXslFilename() ) ) {
          logError( BaseMessages.getString( PKG, "Xslt.Log.ErrorXSLFile" ) );
          throw new KettleStepException( BaseMessages.getString( PKG, "Xslt.Exception.ErrorXSLFile" ) );
        }

        // Check if XSL File exists!
        data.xslfilename = environmentSubstitute( meta.getXslFilename() );
        FileObject file = null;
        try {
          file = KettleVFS.getInstance( getTransMeta().getBowl() ).getFileObject( data.xslfilename );
          if ( !file.exists() ) {
            logError( BaseMessages.getString( PKG, "Xslt.Log.ErrorXSLFileNotExists", data.xslfilename ) );
            throw new KettleStepException( BaseMessages.getString( PKG, "Xslt.Exception.ErrorXSLFileNotExists",
                data.xslfilename ) );

View on GitHub (pinned to f3058517a1)