From home to work

hi there. so i was creating a brand new file from home. Saved it and emailed it to myself.

When i get to work and open the file (with no conversion) I get the following error:
failed to parse document as
unparsable content bpmn:definitions detected
line: 1
column: 0
nested error: unexpected element bpmn:definitions

What is the cause? why did it happen? how can I prevent it?

It is hard to debug your issue without the file. It can be everything, from encoding to missing some content in copy/paste. Please share your bpmn file with us, so we can figure out what might be broken.

This way we may be able to help you in a constructive manner.

Thanks :heart:

Hi, I also have been tussling w this issue, and I am truly stumped. I tried to add the xml directly as a string, imported .bpmn files, and also tried to use createDiagram instead of importXML. All of which results in the same error: “failed to parse document as bpmn:Definitions”. All of the xml attempts that I’ve made, whether it was a string or a file, has been tested on the demo site and they all work. I am using bpmn-js 17.11.1, does the namespace differ from version to version? Any help would be immensely appreciated!

I forgot to add my bpmn that I’m trying with:

const defaultDiagram = <?xml version="1.0" encoding="UTF-8"?> <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn"> <bpmn:process id="Process_1" isExecutable="false"> <bpmn:startEvent id="StartEvent_1" /> </bpmn:process> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1"> <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"> <dc:Bounds x="173" y="102" width="36" height="36" /> </bpmndi:BPMNShape> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> </bpmn:definitions>;

@BrickTop Please do not necrobump old topics. Instead link to this thread from new topic.

If you decide to open a new topic, please provide a larger chunk of the code you use to open the diagram. I was able to open it just fine with the importXML function, only wrapping it in single quotes.