reklis/SVGKit — comment on commit add8144bcdf7da5d6378358815db0247dbdf39c8
File:  line 0
By reklis:

I've taken a look and I think the way it would change things is that right now you've got some graphics groups arrays at the document level. Having a graphics group as a 'first class element' like I'm talking about I think is the approach you are saying you don't like which is a complete DOM. Allow me to elaborate:

Say we have a tree like this:

- Doc
- Element 1
- Group 1
- G1 E1
- G1 E2
- Element 2
- Group 2
- Group 3
- G3 E1
- G3 E2
- G2 E1

Right now elements support sub-elements, just as layers support sub-layers. If we were to allow a group to be a 'regular' element and not treat it any differently, then it would get picked up as an element inside the tree without any special parsing logic, and without any special graphics groups or anonymous graphics groups elements. The parent > child relationships in the DOM would all sort themselves out. Not only would the logic be simpler because we are not doing any special handling, but it would also match what is the actual XML 1:1 so writing things back out while traversing the tree would be simpler as well.

This is my view, I may be missing something, but this seems like the simplest approach to me. Let me know your thoughts.