I'm trying to walk through a complete document and get all nodes of a specific type, in this case <metadata> to populate the new metadata GUI.
My best bet now is to get the current active SPDocument and start to iterate from the root node, depth-first. I've found the sp_repr_lookup_name in "src/xml/repr.h" which do exactly that but stops at the first hit so I would have to wrap it somehow and run it multiple times. If I've understood this correctly it will work on the agnostic XML backbone and not with SPObjects which I should be using but then again RDF implementation doesn't use SPObject in its current state. Am I on the right track or totally lost?
(within repr-util.cpp it seems like you can iterate through a XML::Node's all children with the help of firstChild() and next(), perhaps better than using the c facade function, but will it work with RDF nodes?)
So to my second part, somewhat related, In sp-object.h a comment says "[...] SPObject layer is bound to the SPRepr layer, closely following the SPRepr mutations via callbacks." We have the typed object layer with SPObjects and the agnostic XML layer with SPRepr. The confusion for me now is concerning variable naming, I think, throughout Inkscape codebase both "repr" and "node" are used as variable names for XML::Node objects.
Is SPRepr the old "name" for XML::Node?
If yes, this would mean that everything below Inkscape::XML do work on the the agnostic XML backbone layer and not the SPObjects, have I understood this correctly?