mxGraph: loading XML file

Viewed 2426
2 Answers

Use Codec and Encoder.

var encoder = new mxCodec();
var node = encoder.encode(graph.getModel()); 

variable node will have XML of your graph.

Use mxGraph utility to instantly show XML in popup.

mxUtils.popup(mxUtils.getPrettyXml(node), true);
Related