How to edit bpmn xml targetNamespace?

Such bpmn xml file,if i want to edit its targetNamespace with bpmn methods or other js methods,what should i do?
Thank you.

Here’s an example of editing the target namespace on the definitions object:

I saw its just edit in definitions,so how can i let it to edit and change the result for xml?5747662815581

Have you tried bpmnJS.saveXML((err, xml) => console.log(xml))?

I just tried like this,this is what I want to be,thank you very much guys!

        const _this = this
        const bpmnjs = _this.bpmnModeler
        var definitions = bpmnjs.getDefinitions();
        definitions.set("targetNamespace", _this.params.category);
        _this.bpmnModeler.saveXML({ format: true }, function(err, xml) {
1 Like