{"record":{"id":"01a23d3c9c48592e","repo":"pentaho/pentaho-kettle","slug":"invalid-transformation-name-registertransservlet","errorCode":null,"errorMessage":"Invalid Transformation Name","messagePattern":"Invalid Transformation Name","errorType":"http","errorClass":"SAXException","httpStatus":500,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/www/RegisterTransServlet.java","lineNumber":87,"sourceCode":"      response.setStatus( HttpServletResponse.SC_INTERNAL_SERVER_ERROR );\n      return new WebResult( WebResult.STRING_ERROR, ex.getMessage(), \"\" );\n    }\n  }\n\n  public void validateTransformation( InputStream is ) throws IOException, ParserConfigurationException, SAXException,\n    XPathExpressionException {\n    DocumentBuilderFactory df = DocumentBuilderFactory.newInstance();\n    df.setFeature( \"http://xml.org/sax/features/external-general-entities\", false );\n    df.setFeature( \"http://xml.org/sax/features/external-parameter-entities\", false );\n    DocumentBuilder builder = df.newDocumentBuilder();\n    Document doc = builder.parse( is );\n    if ( !doc.getDocumentElement().getNodeName().equals( \"transformation_configuration\" ) ) {\n      throw new SAXException( \"Invalid Transformation - Missing transformation_configuration tag\" );\n    }\n    XPath xPath = XPathFactory.newInstance().newXPath();\n    Node node = (Node) xPath.evaluate( \"/transformation_configuration/transformation/info/name\", doc, XPathConstants.NODE );\n    if ( node == null  || node.getChildNodes().getLength() > 1 || !( node.getFirstChild() instanceof DeferredTextImpl ) ) {\n      throw new SAXException( \"Invalid Transformation Name\" );\n    }\n  }\n\n}\n","sourceCodeStart":69,"sourceCodeEnd":92,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/www/RegisterTransServlet.java#L69-L92","documentation":"validateTransformation also verifies that /transformation_configuration/transformation/info/name exists, is a single simple text node (DeferredTextImpl), and is well-formed; otherwise SAXException 'Invalid Transformation Name' is thrown. The transformation name inside the configuration export failed these structural checks.","triggerScenarios":"POST /kettle/registerTrans/ where the name node is missing, contains multiple child nodes (nested/mixed content), or is not a plain text node — e.g. CDATA, embedded elements, or an empty/absent <name> in the export.","commonSituations":"Hand-edited or third-party-generated configuration XML with an empty <name/> or wrapped elements; exports produced by different Pentaho versions with differing name node structure; XML built programmatically with attributes/children inside name.","solutions":["Open the posted XML and ensure <info><name>plain-text</name></info> exists with exactly one text child.","Fix the generator producing the export so name is a simple text node (no CDATA, no nested tags).","Re-export the transformation from the same/compatible Pentaho version rather than hand-editing.","Trim whitespace/control characters from the name if the exporter emitted them."],"exampleFix":"// before\n<info><name></name></info>\n// after\n<info><name>My Transformation</name></info>","handlingStrategy":"validation","validationCode":"import javax.xml.xpath.*;\nimport org.w3c.dom.*;\nboolean hasSimpleTransName(Document doc) throws Exception {\n  XPath xp = XPathFactory.newInstance().newXPath();\n  Node n = (Node) xp.evaluate(\"/transformation_configuration/transformation/info/name\", doc, XPathConstants.NODE);\n  return n != null && n.getChildNodes().getLength() == 1 && n.getFirstChild() instanceof org.apache.xerces.dom.DeferredTextImpl;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep <info><name> a single plain-text node: no CDATA, no child elements, non-empty.","Re-export from the Pentaho UI instead of hand-editing configuration XML.","Use consistent Pentaho versions between exporter and registering server.","Strip whitespace/control characters from names when generating XML programmatically."],"tags":["xml","validation","servlet","transformation-name"],"backgroundTag":"schema-validation-failed","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"}