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

When I split the parser into smaller pieces, what I really needed was a way of accessing the SVG in two parallel paths:

1. As a list of renderable objects (a hierarchy of CALayer's that could be animated, moved, changed colour, etc)
2. As a dictionary of semantic meaning (a hierarchy of g tags, custom namespace tags, custom attributes attached at certain points in the tree, etc)

I didn't want to re-implement the concept of DOM from scratch (i.e. parse "every valid XML node and present it as generic objects in a huge tree"), and I wanted something simple to start with - so I went with splitting the parser into:

a. Core parser: parses SVG
...if a tag is found during parsing that is NOT in the core namespace (XMLNS for SVG), then it is *ignored*
b. Optional parsers: parse tags from named additional XML namespaces
...and the core parser automatically inserts/attaches the output of those parsers into the right place in the SVG tree

That was the idea, anyway. I only got as far as handling custom tags (e.g. "") - ultimately, I'd want to add another layer that handles custom attributes inside any tag, (e.g. "")