Bpmn-moddle unable to parse XML generated by editor example


I just downloaded your bpmn-js examples and set up an example application using bpmn-moddle.

It seems that bpmn-moddle is unable to parse the XML generated by the editor:

var xml = '...'

var BpmnModdle = require('bpmn-moddle');

var moddle = new BpmnModdle();

moddle.fromXML(xml, function(err, definitions) {
    console.log("Converted: ",  definitions)

Generates this error-message:

could not parse node
[Error: unrecognized element <bpmn2:collaboration>]
could not parse node
[Error: unrecognized element <bpmn2:process>]
[Error: Unbound namespace prefix: "dc:Bounds"
Line: 0
Column: 4581
Char: >]
Converted:  undefined

These errors indicate that the BPMN 2.0 XML is invalid, i.e. due to a bad export.

Check this one for more ways to…parse xml