{"record":{"id":"0abc77ded826c891","repo":"flowable/flowable-engine","slug":"error-while-moving-down-in-xml-document","errorCode":null,"errorMessage":"Error while moving down in XML document","messagePattern":"Error while moving down in XML document","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"modules/flowable-dmn-xml-converter/src/main/java/org/flowable/dmn/xml/converter/XMLStreamReaderUtil.java","lineNumber":42,"sourceCode":"public class XMLStreamReaderUtil {\n\n    protected static final Logger LOGGER = LoggerFactory.getLogger(XMLStreamReaderUtil.class);\n\n    public static String moveDown(XMLStreamReader xtr) {\n        try {\n            while (xtr.hasNext()) {\n                int event = xtr.next();\n                switch (event) {\n                case XMLStreamConstants.END_DOCUMENT:\n                    return null;\n                case XMLStreamConstants.START_ELEMENT:\n                    return xtr.getLocalName();\n                case XMLStreamConstants.END_ELEMENT:\n                    return null;\n                }\n            }\n        } catch (Exception e) {\n            LOGGER.warn(\"Error while moving down in XML document\", e);\n        }\n        return null;\n    }\n\n    public static boolean moveToEndOfElement(XMLStreamReader xtr, String elementName) {\n        try {\n            while (xtr.hasNext()) {\n                int event = xtr.next();\n                switch (event) {\n                case XMLStreamConstants.END_DOCUMENT:\n                    return false;\n                case XMLStreamConstants.END_ELEMENT:\n                    if (xtr.getLocalName().equals(elementName)) {\n                        return true;\n                    }\n                    break;\n                }\n            }","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-xml-converter/src/main/java/org/flowable/dmn/xml/converter/XMLStreamReaderUtil.java#L24-L60","documentation":"This is a warning logged (not a thrown exception) by XMLStreamReaderUtil.moveDown, a helper that advances a StAX XMLStreamReader into the first child of the current element and returns its local name. Any exception while reading the stream (malformed XML, IO problem, invalid cursor state) is caught, logged, and null is returned, so converters silently treat the element as having no children.","triggerScenarios":"Calling moveDown when the stream reader is positioned on a malformed region of the DMN XML, the underlying stream throws an XMLStreamException, or the cursor is already at/near the end of the document when a child is expected.","commonSituations":"Truncated or corrupt DMN/BPMN XML files (incomplete upload); XML with encoding declarations that do not match the actual bytes; elements closed in the wrong order; deploying a file where XML got mangled by an HTTP proxy or editor.","solutions":["Validate the XML file is well-formed before conversion (xmllint --noout or an XML parser dry run)","Inspect the logged cause: an XMLStreamException usually pinpoints the line/column of the malformed content","Re-save the file with correct encoding (UTF-8) and re-upload; check for BOM or mixed encodings","Recover the original DMN/BPMN file from source control or re-export it from the modeler"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Ensure well-formedness before handing the stream to converters\nXMLStreamReader xtr = factory.createXMLStreamReader(in);\nwhile (xtr.hasNext()) { xtr.next(); } // throws XMLStreamException on malformed XML","typeGuard":null,"tryCatchPattern":"// moveDown returns null on error; null-check the result\nString child = XMLStreamReaderUtil.moveDown(xtr);\nif (child == null) {\n  throw new IllegalStateException(\"moveDown failed or no child element; check converter warn log\");\n}","preventionTips":["Run xmllint --noout on DMN/BPMN files before deployment","Deploy files as UTF-8 without BOM and with matching encoding declarations","Avoid truncation: verify upload size/completeness of XML resources","Treat the warn log as the real error signal; grep logs for 'moving down in XML document'"],"tags":["xml-parsing","stax","dmn"],"backgroundTag":"json-parse-error","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}