jgraph/mxgraph

4.1.0 export XML does not work

Closed this issue · 1 comments

export XML does not work

let xml = '<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="6" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.25;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="3" target="4"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="3" value="Button2" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dc3545;fontSize=12;fontColor=white;strokeColor=none;" vertex="1" parent="1"><mxGeometry x="140" y="20" width="60" height="30" as="geometry"/></mxCell><mxCell id="8" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="4" target="7"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="4" target="5"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="4" value="Button5" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#28a745;fontSize=12;fontColor=white;strokeColor=none" vertex="1" parent="1"><mxGeometry x="170" y="110" width="60" height="30" as="geometry"/></mxCell><mxCell id="7" value="Button5" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#28a745;fontSize=12;fontColor=white;strokeColor=none" vertex="1" parent="1"><mxGeometry x="170" y="220" width="60" height="30" as="geometry"/></mxCell><mxCell id="5" value="Button4" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffc107;fontSize=12;fontColor=white;strokeColor=none;" vertex="1" parent="1"><mxGeometry x="350" y="110" width="60" height="30" as="geometry"/></mxCell></root></mxGraphModel>'; var xmlDoc = mxUtils.parseXml(xml); var codec = new mxCodec(xmlDoc); codec.decode(xmlDoc.documentElement, graph.getModel());

Can you please elaborate? what is not working? what is the error?
I use this mxGraph version and have no issue loading/exporting from various mxGraphModel xml sources.