{"record":{"id":"6351017401e8d3f9","repo":"pentaho/pentaho-kettle","slug":"getxmldatameta-exception-errorloadingxml-localized-message","errorCode":null,"errorMessage":"GetXMLDataMeta.Exception.ErrorLoadingXML (localized message with error)","messagePattern":"GetXMLDataMeta\\.Exception\\.ErrorLoadingXML \\(localized message with error\\)","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/getxmldata/GetXMLDataMeta.java","lineNumber":857,"sourceCode":"      // Do we skip rows before starting to read\n      loopxpath = XMLHandler.getTagValue( stepnode, TAG_LOOPXPATH );\n\n      inFields = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, TAG_IS_IN_FIELDS ) );\n      IsAFile = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, TAG_IS_A_FILE ) );\n\n      xmlField = XMLHandler.getTagValue( stepnode, TAG_XML_FIELD );\n      prunePath = XMLHandler.getTagValue( stepnode, TAG_PRUNE_PATH );\n\n      shortFileFieldName = XMLHandler.getTagValue( stepnode, TAG_SHORT_FILE_FIELD_NAME );\n      pathFieldName = XMLHandler.getTagValue( stepnode, TAG_PATH_FIELD_NAME );\n      hiddenFieldName = XMLHandler.getTagValue( stepnode, TAG_HIDDEN_FIELD_NAME );\n      lastModificationTimeFieldName = XMLHandler.getTagValue( stepnode, TAG_LAST_MODIFICATION_TIME_FIELD_NAME );\n      uriNameFieldName = XMLHandler.getTagValue( stepnode, TAG_URI_NAME_FIELD_NAME );\n      rootUriNameFieldName = XMLHandler.getTagValue( stepnode, TAG_ROOT_URI_NAME_FIELD_NAME );\n      extensionFieldName = XMLHandler.getTagValue( stepnode, TAG_EXTENSION_FIELD_NAME );\n      sizeFieldName = XMLHandler.getTagValue( stepnode, TAG_SIZE_FIELD_NAME );\n    } catch ( Exception e ) {\n      throw new KettleXMLException( BaseMessages.getString( PKG, \"GetXMLDataMeta.Exception.ErrorLoadingXML\", e\n          .toString() ) );\n    }\n  }\n\n  public void allocate( int nrfiles, int nrfields ) {\n    allocateFiles( nrfiles );\n    inputFields = new GetXMLDataField[nrfields];\n  }\n\n  public void allocateFiles( int nrfiles ) {\n    fileName = new String[nrfiles];\n    fileMask = new String[nrfiles];\n    excludeFileMask = new String[nrfiles];\n    fileRequired = new String[nrfiles];\n    includeSubFolders = new String[nrfiles];\n  }\n\n  public void setDefault() {","sourceCodeStart":839,"sourceCodeEnd":875,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/getxmldata/GetXMLDataMeta.java#L839-L875","documentation":"GetXMLDataMeta.loadXML wraps any exception raised while reading step settings from the transformation XML (ktr) in a KettleXMLException with localized message 'GetXMLDataMeta.Exception.ErrorLoadingXML' plus e.toString(). It means the step's XML metadata could not be deserialized.","triggerScenarios":"The GetXMLDataMeta constructor taking (stepnode, ...) throws when XMLHandler.getTagValue or related parsing fails - typically a structural problem in the <step> node of the .ktr file.","commonSituations":"Hand-edited or corrupted .ktr files, transformations produced by a newer/older PDI version with changed XML schema, XML escaping issues in field names, repository/metadata import of foreign files.","solutions":["Read the chained e.toString() message to find which XML tag failed to parse.","Open the .ktr in a text editor and validate the XML is well-formed; repair or restore from backup/version control.","Recreate the GetXMLData step in Spoon and re-enter its settings, then save a fresh .ktr.","Align PDI versions: open the transformation with the version that produced it, or migrate via Spoon."],"exampleFix":"// before: malformed tag in .ktr\n<lastmodtime_field></lastmodtime-field>\n// after: well-formed, correctly closed tag\n<lastmodtime_field></lastmodtime_field>","handlingStrategy":"try-catch","validationCode":"// Validate the .ktr XML before loading\nDocument doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse( new File( \"t.ktr\" ) ); // throws on malformed XML","typeGuard":null,"tryCatchPattern":"try { transMeta = new TransMeta( \"t.ktr\" ); } catch ( KettleXMLException e ) { log.error( \"Bad step metadata: \" + e.getMessage(), e ); /* restore from VCS/backup */ }","preventionTips":["Keep transformations under version control; never hand-edit .ktr files casually.","Open transformations with a PDI version compatible with the one that saved them.","Validate .ktr files against XML well-formedness before automated loads."],"tags":["pentaho-kettle","xml","metadata","serialization"],"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"}