{"record":{"id":"3d21b2111cea6713","repo":"pentaho/pentaho-kettle","slug":"xsltmeta-exception-unabletoloadstepinfofromxml","errorCode":null,"errorMessage":"XsltMeta.Exception.UnableToLoadStepInfoFromXML","messagePattern":"XsltMeta\\.Exception\\.UnableToLoadStepInfoFromXML","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/xslt/XsltMeta.java","lineNumber":276,"sourceCode":"      int nrparams = XMLHandler.countNodes( parametersNode, \"parameter\" );\n\n      Node parametersOutputProps = XMLHandler.getSubNode( stepnode, \"outputproperties\" );\n      int nroutputprops = XMLHandler.countNodes( parametersOutputProps, \"outputproperty\" );\n      allocate( nrparams, nroutputprops );\n\n      for ( int i = 0; i < nrparams; i++ ) {\n        Node anode = XMLHandler.getSubNodeByNr( parametersNode, \"parameter\", i );\n        parameterField[i] = XMLHandler.getTagValue( anode, \"field\" );\n        parameterName[i] = XMLHandler.getTagValue( anode, \"name\" );\n      }\n      for ( int i = 0; i < nroutputprops; i++ ) {\n        Node anode = XMLHandler.getSubNodeByNr( parametersOutputProps, \"outputproperty\", i );\n        outputPropertyName[i] = XMLHandler.getTagValue( anode, \"name\" );\n        outputPropertyValue[i] = XMLHandler.getTagValue( anode, \"value\" );\n      }\n\n    } catch ( Exception e ) {\n      throw new KettleXMLException( BaseMessages.getString( PKG, \"XsltMeta.Exception.UnableToLoadStepInfoFromXML\" ), e );\n    }\n  }\n\n  public void setDefault() {\n    xslFilename = null;\n    fieldName = null;\n    resultFieldname = \"result\";\n    xslFactory = \"JAXP\";\n    xslFileField = null;\n    xslFileFieldUse = false;\n    xslFieldIsAFile = true;\n\n    int nrparams = 0;\n    int nroutputproperties = 0;\n    allocate( nrparams, nroutputproperties );\n\n    for ( int i = 0; i < nrparams; i++ ) {\n      parameterField[i] = \"param\" + i;","sourceCodeStart":258,"sourceCodeEnd":294,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/xslt/XsltMeta.java#L258-L294","documentation":"Thrown by XsltMeta.readData (invoked from loadXML) when any exception occurs while deserializing the step's configuration from a transformation .ktr XML file. The step metadata (filenames, parameters, output properties) cannot be parsed from its XML nodes. The original exception is attached as the cause.","triggerScenarios":"Loading a transformation whose XSLT step XML is malformed: missing <fields>/<parameters>/<outputproperties> nodes, wrong node counts, or a hand-edited/corrupted .ktr file; XMLHandler.getSubNodeByNr returns null and downstream access throws NPE.","commonSituations":"Hand-editing the .ktr file; merging transformations with conflicting XML; file corruption from an aborted save; opening a transformation created in a newer Pentaho version in an older one.","solutions":["Open the .ktr in a text editor and fix/restore the XML block for the XSLT step (compare with a known-good transformation)","Restore the transformation from version control or backup","Recreate the XSLT step in Spoon and re-enter its settings; check the 'cause' exception for the exact parse failure"],"exampleFix":"// before\n<outputproperties><outputproperty><value>yes</value></outputproperty></outputproperties> // missing <name>\n// after\n<outputproperties><outputproperty><name>indent</name><value>yes</value></outputproperty></outputproperties>","handlingStrategy":"try-catch","validationCode":"// Sanity-check the .ktr XML before loading\nDocument doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(ktrFile);\nif (XMLHandler.getSubNode(doc, \"transformation\") == null) {\n    throw new IllegalArgumentException(\"Not a valid transformation file\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    TransMeta transMeta = new TransMeta(ktrFile, repo, metaStore);\n} catch (KettleXMLException e) {\n    log.error(\"Failed to load step info from XML: \" + e.getMessage(), e.getCause());\n    // fall back to backup .ktr or recreate the step\n}","preventionTips":["Never hand-edit .ktr files; use Spoon","Keep transformations in version control for easy restore","Ensure producer and consumer Pentaho versions are compatible"],"tags":["kettle","xml","step-metadata","deserialization"],"backgroundTag":"xml-parse-error","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"}