pentaho/pentaho-kettle · error · KettleXMLException

XsltMeta.Exception.UnableToLoadStepInfoFromXML

Error message

XsltMeta.Exception.UnableToLoadStepInfoFromXML

What it means

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.

Solutions

  1. Open the .ktr in a text editor and fix/restore the XML block for the XSLT step (compare with a known-good transformation)
  2. Restore the transformation from version control or backup
  3. Recreate the XSLT step in Spoon and re-enter its settings; check the 'cause' exception for the exact parse failure

Example fix

// before
<outputproperties><outputproperty><value>yes</value></outputproperty></outputproperties> // missing <name>
// after
<outputproperties><outputproperty><name>indent</name><value>yes</value></outputproperty></outputproperties>
Defensive patterns

Strategy: try-catch

Validate before calling

// Sanity-check the .ktr XML before loading
Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(ktrFile);
if (XMLHandler.getSubNode(doc, "transformation") == null) {
    throw new IllegalArgumentException("Not a valid transformation file");
}

Try / catch

try {
    TransMeta transMeta = new TransMeta(ktrFile, repo, metaStore);
} catch (KettleXMLException e) {
    log.error("Failed to load step info from XML: " + e.getMessage(), e.getCause());
    // fall back to backup .ktr or recreate the step
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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

Appendix: source

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

      int nrparams = XMLHandler.countNodes( parametersNode, "parameter" );

      Node parametersOutputProps = XMLHandler.getSubNode( stepnode, "outputproperties" );
      int nroutputprops = XMLHandler.countNodes( parametersOutputProps, "outputproperty" );
      allocate( nrparams, nroutputprops );

      for ( int i = 0; i < nrparams; i++ ) {
        Node anode = XMLHandler.getSubNodeByNr( parametersNode, "parameter", i );
        parameterField[i] = XMLHandler.getTagValue( anode, "field" );
        parameterName[i] = XMLHandler.getTagValue( anode, "name" );
      }
      for ( int i = 0; i < nroutputprops; i++ ) {
        Node anode = XMLHandler.getSubNodeByNr( parametersOutputProps, "outputproperty", i );
        outputPropertyName[i] = XMLHandler.getTagValue( anode, "name" );
        outputPropertyValue[i] = XMLHandler.getTagValue( anode, "value" );
      }

    } catch ( Exception e ) {
      throw new KettleXMLException( BaseMessages.getString( PKG, "XsltMeta.Exception.UnableToLoadStepInfoFromXML" ), e );
    }
  }

  public void setDefault() {
    xslFilename = null;
    fieldName = null;
    resultFieldname = "result";
    xslFactory = "JAXP";
    xslFileField = null;
    xslFileFieldUse = false;
    xslFieldIsAFile = true;

    int nrparams = 0;
    int nroutputproperties = 0;
    allocate( nrparams, nroutputproperties );

    for ( int i = 0; i < nrparams; i++ ) {
      parameterField[i] = "param" + i;

View on GitHub (pinned to f3058517a1)