pentaho/pentaho-kettle · error · KettleStepException

Xslt.Exception.ErrorXMLFieldMissing

Error message

Xslt.Exception.ErrorXMLFieldMissing

What it means

The XSLT step requires the name of the incoming field containing the XML to transform. If meta.getFieldname() is empty, processRow logs 'ErrorXMLFieldMissing' and throws this KettleStepException before processing any rows.

Solutions

  1. Open the XSLT step dialog and set 'XML fieldname' to the incoming field holding the XML.
  2. Ensure the previous step outputs a field with that exact name.
  3. Re-save the transformation so the fieldname attribute persists.

Example fix

// before
XML fieldname: (empty)
// after
XML fieldname: xml_content  // String field from previous step
Defensive patterns

Strategy: validation

Validate before calling

if (meta.getFieldname() == null || meta.getFieldname().isEmpty()) { throw new IllegalArgumentException("XSLT step requires an XML fieldname"); }

Try / catch

try { step.startThreads(); } catch (KettleStepException e) { if (e.getMessage().contains("ErrorXMLFieldMissing")) { /* fix XML fieldname in dialog */ } }

Prevention

When it happens

Trigger: processRow begins and Utils.isEmpty(meta.getFieldname()) is true — the 'XML fieldname' setting in the XSLT step dialog is blank.

Common situations: Step configured only partially; upstream step renamed/removed the XML source field but the XML fieldname setting itself was never set; template-based step creation skipped configuration.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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

Appendix: source

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

    }
    if ( first ) {
      first = false;
      data.outputRowMeta = getInputRowMeta().clone();
      meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,
                      metaStore );

      // Check if The result field is given
      if ( Utils.isEmpty( meta.getResultfieldname() ) ) {
        // Result Field is missing !
        logError( BaseMessages.getString( PKG, "Xslt.Log.ErrorResultFieldMissing" ) );
        throw new KettleStepException( BaseMessages.getString( PKG, "Xslt.Exception.ErrorResultFieldMissing" ) );
      }

      // Check if The XML field is given
      if ( Utils.isEmpty( meta.getFieldname() ) ) {
        // Result Field is missing !
        logError( BaseMessages.getString( PKG, "Xslt.Exception.ErrorXMLFieldMissing" ) );
        throw new KettleStepException( BaseMessages.getString( PKG, "Xslt.Exception.ErrorXMLFieldMissing" ) );
      }

      // Try to get XML Field index
      data.fieldposition = getInputRowMeta().indexOfValue( meta.getFieldname() );
      // Let's check the Field
      if ( data.fieldposition < 0 ) {
        // The field is unreachable !
        logError( BaseMessages.getString( PKG, "Xslt.Log.ErrorFindingField" ) + "[" + meta.getFieldname() + "]" );
        throw new KettleStepException( BaseMessages.getString( PKG, "Xslt.Exception.CouldnotFindField", meta
            .getFieldname() ) );
      }

      // 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" ) );

View on GitHub (pinned to f3058517a1)