{"record":{"id":"eff5e44d66856a32","repo":"pentaho/pentaho-kettle","slug":"unable-to-transform-dom-node-with-name-node-getnodename-to","errorCode":null,"errorMessage":"Unable to transform DOM node with name [ + node.getNodeName() + ] to XML","messagePattern":"Unable to transform DOM node with name \\[ \\+ node\\.getNodeName\\(\\) \\+ \\] to XML","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/webservices/WebService.java","lineNumber":1044,"sourceCode":"      try {\n        rowValue = getValue( textContent, field );\n        outputRowData[ outputIndex ] = rowValue;\n        return true;\n      } catch ( Exception e ) {\n        throw new KettleException( \"Unable to convert value [\"\n          + textContent + \"] for field [\" + field.getWsName() + \"], type [\" + field.getXsdType() + \"]\", e );\n      }\n    } else if ( node.getNodeType() == Node.ELEMENT_NODE ) {\n      // Perhaps we're dealing with complex data types.\n      // Perhaps we can just ship the XML snippet over to the next steps.\n      //\n      try {\n        StringWriter childNodeXML = new StringWriter();\n        transformer.transform( new DOMSource( node ), new StreamResult( childNodeXML ) );\n        outputRowData[ outputIndex ] = childNodeXML.toString();\n        return true;\n      } catch ( Exception e ) {\n        throw new KettleException( \"Unable to transform DOM node with name [\" + node.getNodeName() + \"] to XML\", e );\n      }\n    }\n\n    // Nothing found, return false\n    //\n    return false;\n  }\n\n  private Object getValue( String vNodeValue, WebServiceField field ) throws XMLStreamException, ParseException {\n    if ( vNodeValue == null ) {\n      return null;\n    } else {\n      if ( XsdType.BOOLEAN.equals( field.getXsdType() ) ) {\n        return Boolean.valueOf( vNodeValue );\n      } else if ( XsdType.DATE.equals( field.getXsdType() ) ) {\n        try {\n          return dateFormat.parse( vNodeValue );\n        } catch ( ParseException e ) {","sourceCodeStart":1026,"sourceCodeEnd":1062,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/webservices/WebService.java#L1026-L1062","documentation":"KettleException thrown by WebService.getNodeValue when the DOM node holds complex data and the code tries to serialize it to an XML string via transformer.transform(new DOMSource(node), new StreamResult(childNodeXML)) but the transformation fails. The node's name is included in the message.","triggerScenarios":"Complex-type branch of getNodeValue: TransformerConfigurationException or TransformException while serializing — bad TransformerFactory configuration, node detached from a document in a way the transformer rejects, or unsupported node state.","commonSituations":"Custom TransformerFactory/serializer (e.g. Xalan version conflict on the classpath) misbehaving; node obtained from a differently-built DOM that the transformer can't source; JVM with restricted XML features (security manager blocking extensions).","solutions":["Read the wrapped cause 'e' in the log to see the underlying TransformerException and fix accordingly.","Check for Xalan/JAXP implementation conflicts on the classpath and align the TransformerFactory version.","Verify the node is still attached to a live Document (not one that has been released) before transforming.","As a fallback, serialize manually via DOMSource with an identity transformer created fresh per call."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Smoke-test identity transformation once at startup to catch factory problems early:\nTransformer t = TransformerFactory.newInstance().newTransformer();\nt.transform(new DOMSource(DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument()),\n            new StreamResult(new StringWriter()));","typeGuard":null,"tryCatchPattern":"try {\n  // run transformation\n} catch (KettleException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"Unable to transform DOM node\")) {\n    // inspect e.getCause(): usually a TransformerFactory/classpath (Xalan) conflict\n  }\n}","preventionTips":["Keep a single consistent Xalan/JAXP implementation on the classpath.","Test complex-type pass-through after JVM or library upgrades.","Ensure nodes are from a live, unreleased Document before serializing."],"tags":["kettle","webservice","xml","transformer"],"backgroundTag":"xml-transform-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"}