{"record":{"id":"4c63365f5d794e8e","repo":"pentaho/pentaho-kettle","slug":"xslt-exception-errorxslnotafile","errorCode":null,"errorMessage":"Xslt.Exception.ErrorXSLNotAFile","messagePattern":"Xslt\\.Exception\\.ErrorXSLNotAFile","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/xslt/Xslt.java","lineNumber":142,"sourceCode":"      } 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 ) );\n          }\n          if ( file.getType() != FileType.FILE ) {\n            logError( BaseMessages.getString( PKG, \"Xslt.Log.ErrorXSLNotAFile\", data.xslfilename ) );\n            throw new KettleStepException( BaseMessages.getString( PKG, \"Xslt.Exception.ErrorXSLNotAFile\",\n                data.xslfilename ) );\n          }\n        } catch ( Exception e ) {\n          throw new KettleStepException( e );\n        } finally {\n          try {\n            if ( file != null ) {\n              file.close();\n            }\n          } catch ( Exception e ) { /* Ignore */\n          }\n        }\n      }\n\n      // Check output parameters\n      int nrOutputProps = meta.getOutputPropertyName() == null ? 0 : meta.getOutputPropertyName().length;\n      if ( nrOutputProps > 0 ) {\n        data.outputProperties = new Properties();","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/xslt/Xslt.java#L124-L160","documentation":"Thrown by the XSLT step during processRow when the configured XSL stylesheet path exists but is not a regular file (e.g. it is a directory or a special VFS object). The step resolves the XSL filename through Apache Commons VFS and validates its FileType before using it for transformation. It fails fast because XSLT processing cannot proceed without a valid stylesheet file.","triggerScenarios":"The 'XSL File' field in the XSLT step points to a directory, an archive/folder VFS endpoint, or another non-file resource after environmentSubstitute() resolution; file.getType() != FileType.FILE.","commonSituations":"Typing a folder path instead of the .xsl file; using a variable that resolves to a directory; pointing at an S3/VFS collection; copy-pasting a path without the filename.","solutions":["Correct the XSL filename in the step dialog to point to the actual .xsl stylesheet file","If a variable is used, verify at runtime that it resolves to a full file path ending in the stylesheet, not a directory","Check the file exists and is a regular file on the filesystem or VFS mount the transformation runs on"],"exampleFix":"// before\nXSL filename: /opt/stylesheets/\n// after\nXSL filename: /opt/stylesheets/transform.xsl","handlingStrategy":"validation","validationCode":"// Before running the transformation\nFile f = new File(xslFilename);\nif (!f.exists() || !f.isFile()) {\n    throw new IllegalArgumentException(\"XSL path is not a regular file: \" + xslFilename);\n}","typeGuard":"boolean isValidXslFile(String path) {\n    File f = new File(path);\n    return f.exists() && f.isFile() && path.toLowerCase().endsWith(\".xsl\");\n}","tryCatchPattern":null,"preventionTips":["Always point the XSL field at the stylesheet file, never its parent directory","Resolve and check variables before deploying the transformation","Add a 'Check if file exists' style validation step upstream"],"tags":["xslt","kettle","vfs","file-validation"],"backgroundTag":"path-is-not-a-file","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"}