bin/bpmnlint.js
function parseDiagram(diagramXML) {
  return new Promise((resolve, reject) => {
    moddle.fromXML(diagramXML, (error, moddleElement, context) => {

      if (error) {
        return resolve({
          error
        });
      }

      const warnings = context.warnings || [];

      return resolve({
        moddleElement,
        warnings
      });
    });
  });
}
function parseDiagram(diagramXML) {
  return new Promise((resolve, reject) => {
    moddle.fromXML(diagramXML, (error, moddleElement, context) => {

      if (error) {
        return resolve({
          error
        });
      }

      const warnings = context.warnings || [];

      return resolve({
        moddleElement,
        warnings
      });
    });
  });
}
function parseDiagram ( diagramXML ) { return new Promise ( ( resolve , reject ) => { moddle . fromXML ( diagramXML , ( error , moddleElement , context ) => { if ( error ) { return resolve ( { error } ) ; } const warnings = context . warnings || [ ] ; return resolve ( { moddleElement , warnings } ) ; } ) ; } ) ; }
Reads XML form path and return moddle object
@param {*} sourcePath
Reads XML form path and return moddle object