{"record":{"id":"073e0185b3b3b58b","repo":"pentaho/pentaho-kettle","slug":"xslt-exception-errorxslfilefieldfinding","errorCode":null,"errorMessage":"Xslt.Exception.ErrorXSLFileFieldFinding","messagePattern":"Xslt\\.Exception\\.ErrorXSLFileFieldFinding","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/xslt/Xslt.java","lineNumber":120,"sourceCode":"\n      // Check if the XSL Filename is contained in a column\n      if ( meta.useXSLField() ) {\n        if ( Utils.isEmpty( meta.getXSLFileField() ) ) {\n          // The field is missing\n          // Result field is missing !\n          logError( BaseMessages.getString( PKG, \"Xslt.Log.ErrorXSLFileFieldMissing\" ) );\n          throw new KettleStepException( BaseMessages.getString( PKG, \"Xslt.Exception.ErrorXSLFileFieldMissing\" ) );\n        }\n\n        // Try to get Field index\n        data.fielxslfiledposition = getInputRowMeta().indexOfValue( meta.getXSLFileField() );\n\n        // Let's check the Field\n        if ( data.fielxslfiledposition < 0 ) {\n          // The field is unreachable !\n          logError( BaseMessages.getString( PKG, \"Xslt.Log.ErrorXSLFileFieldFinding\" ) + \"[\" + meta.getXSLFileField()\n              + \"]\" );\n          throw new KettleStepException( BaseMessages.getString( PKG, \"Xslt.Exception.ErrorXSLFileFieldFinding\", meta\n              .getXSLFileField() ) );\n        }\n\n      } else {\n        if ( Utils.isEmpty( meta.getXslFilename() ) ) {\n          logError( BaseMessages.getString( PKG, \"Xslt.Log.ErrorXSLFile\" ) );\n          throw new KettleStepException( BaseMessages.getString( PKG, \"Xslt.Exception.ErrorXSLFile\" ) );\n        }\n\n        // Check if XSL File exists!\n        data.xslfilename = environmentSubstitute( meta.getXslFilename() );\n        FileObject file = null;\n        try {\n          file = KettleVFS.getInstance( getTransMeta().getBowl() ).getFileObject( data.xslfilename );\n          if ( !file.exists() ) {\n            logError( BaseMessages.getString( PKG, \"Xslt.Log.ErrorXSLFileNotExists\", data.xslfilename ) );\n            throw new KettleStepException( BaseMessages.getString( PKG, \"Xslt.Exception.ErrorXSLFileNotExists\",\n                data.xslfilename ) );","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/xslt/Xslt.java#L102-L138","documentation":"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.","triggerScenarios":"useXSLField() is true, the XSLFileField name is non-empty, but indexOfValue returns -1 on the first incoming row.","commonSituations":"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.","solutions":["Verify the exact field name output by the previous step and correct 'XSL fieldname' (case-sensitive).","Re-run 'Get fields' in the dialog after upstream changes.","Add a step to restore/pass through the XSL path field."],"exampleFix":"// before\nXSL fieldname: StylesheetPath\n// after (upstream field: stylesheet_path)\nXSL fieldname: stylesheet_path","handlingStrategy":"validation","validationCode":"String f = meta.getXSLFileField(); if (f != null && previousRowMeta.indexOfValue(f) < 0) { throw new IllegalArgumentException(\"XSL field '\" + f + \"' not found in incoming stream\"); }","typeGuard":null,"tryCatchPattern":"try { step.startThreads(); } catch (KettleStepException e) { if (e.getMessage().contains(\"ErrorXSLFileFieldFinding\")) { /* correct the XSL fieldname to an existing upstream field */ } }","preventionTips":["Use 'Get fields' after any upstream change","Keep field names stable across refactors of the transformation","Avoid case-mismatched field names"],"tags":["xslt","kettle","field-not-found","row-stream"],"backgroundTag":"record-not-found","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}