I am looking for more documentation on the xml schemas of the draw.io output formats. I have created a parser for the draw.io diagrams but am only guessing at the schema based on the examples I have created and downloaded.
This is obviously a sub-optimal plan of action for me because I have no idea if I am actually correct in my assumptions. I would like to be more confirmed that a new diagram won’t break my parser.
I also noticed that the draw.io team changed its schema in the last few months and this broke my parser. Does the core team plan on:
Many thanks for any help.
Geoff
Tutamantic
From the top of my head it was the way you originally used ‘mxcell’ nodes to portray some objects (connectors), but then you also had ‘object’ nodes to portray them also (shapes).
I am trying to create a set of linked objects in memory, e.g. a ‘shape’ then ‘connector’ then ‘shape’ again, etc. I’m doing this for all of the connected shapes in the diagram. I have added name/value pairs to each of the shapes and connectors, and my code parses through these chains and collects the name/value pairs from each shape and connector. I then do some further analysis processing.
The draw.io schema makes it challenging for me to get the data from the shapes and connectors because I needed to differentiate between the shapes and connectors. I did this a while back and everything worked ok.
But it seemed that the schema changed in the last few months and my parser failed to get the information from the connectors because my routine was unable to find the proper nodes.
I finally went back and created a number of new diagrams (using the same layouts as the older ones) to figure out what the changes were and I fixed the issue. It seems that draw.io changed the relationship between ‘mxcell’ and ‘object’. It seems that draw.io changes a ‘mxcell’ to an ‘object’ when I add the name/value pair data to any shape or connector.
I still don’t know for sure if I am parsing the xml correctly. It seems to be working at the moment, but I have no way to verify.
My challenge is that I am trying to bring forward my product and I need some way to be informed of any changes before they break my parser. Many of my customers use draw.io and I want to cater to them. Is there any way to get informed of schema changes before they happen so I don’t have embarrassing broken parser issues?
Geoffrey Hill Tutamantic
--
You received this message because you are subscribed to the Google Groups "draw.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
drawio+un...@googlegroups.com.
To view this discussion on the web, visit
https://groups.google.com/d/msgid/drawio/cd15f939-a231-4494-833d-98c280f7375c%40googlegroups.com.
For more options, visit
https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to drawio+unsubscribe@googlegroups.com.
I’m using the draw.io output exactly as-is.
The change had to do with how draw.io deals with metadata. Originally the output for the shapes was the same as the connectors. But that changed.
Here’s an example.
The shape node doesn’t act in the same way as the change to the connector node. The connector node adds an ‘object’ to the connector’s ‘mxcell’. The shape node wraps its original ‘mxcell’ with an ‘object’. Why isn’t the change done consistently?
I created a shape originally and it gave me:
<mxCell id="24" value="DB Server" style="shape=cylinder;whiteSpace=wrap;html=1;boundedLbl=1;" vertex="1" parent="1">
<mxGeometry x="240" y="830" width="60" height="80" as="geometry"/>
</mxCell>
When I added the name/value pairs, draw.io completely changed the xml. I got this:
<object label="DB Server" Zone="3" Attribute="BLAH.BLAH.BLAH" CRUDE="" id="3">
<mxCell style="shape=cylinder;whiteSpace=wrap;html=1;strokeWidth=1;" vertex="1" parent="1">
<mxGeometry x="240" y="890" width="60" height="80" as="geometry"/>
</mxCell>
</object>
-----
Connectors are a bit more simple at least because the draw.io process only adds an object to hold the metadata and keeps the mxcell as the top-level cell.
Connectors have the following originally:
<mxCell id="32" value="user-to-WebServer" style="text;html=1;resizable=0;points=[];align=center;verticalAlign=middle;labelBackgroundColor=#ffffff;" vertex="1" connectable="0" parent="26">
<mxGeometry x="-0.0875" relative="1" as="geometry">
<mxPoint as="offset"/>
</mxGeometry>
</mxCell>
Which changes to this after I add name/value pairs. The ‘parent’ attribute on the second top-level node (‘mxcell’) below shows me what I believe holds all my information:
<object label="" Zone="" Attribute="" CRUDE="RU" id="9">
<mxCell style="endArrow=classic;html=1;exitX=0.625;exitY=1.017;exitPerimeter=0;entryX=0.5;entryY=0;" edge="1" parent="1" source="2" target="7">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="580" y="1040" as="sourcePoint"/>
<mxPoint x="260" y="500" as="targetPoint"/>
</mxGeometry>
</mxCell>
</object>
<mxCell id="16" value="user-to-WebServer" style="text;html=1;resizable=0;points=[];align=center;verticalAlign=middle;labelBackgroundColor=#ffffff;" vertex="1" connectable="0" parent="9">
<mxGeometry x="-0.0661" y="1" relative="1" as="geometry">
<mxPoint as="offset"/>
</mxGeometry>
</mxCell>
To unsubscribe from this group and stop receiving emails from it, send an email to drawio+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/drawio/cd15f939-a231-4494-833d-98c280f7375c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "draw.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
drawio+un...@googlegroups.com.
To view this discussion on the web, visit
https://groups.google.com/d/msgid/drawio/92eaaa33-d1fe-4a6b-a06f-a27be2b3c8a9%40googlegroups.com.