Aredridel wrote:
> What I'd like to see is a library (I /am/ working on code for this) that
> would allow one to tell the parser what classes represent what tags in
> what namespaces, and how to map them, so that all one ever needs to do
> is pretend the XML file is a bunch of Ruby objects.

I've done exactly this for C++ in my XmlBind library. It relies
on you implementing the XmlDocumentTypeHandler interface for each
document type (and namespace, in a version we aren't using yet).
This interface gets asked to make objects for a passed element
name, and the returned objects must support the XmlNode interface.
Parent nodes get passed completed child nodes, which they are
responsible for maintaining. That leaves a fair bit of flexibility
in how you create the nodes, it works nicely.

After I did it I found a research paper that talked about someone
doing something pretty similar, which also used the term "bind" -
that might help you find it.

Unfortunately I can't publish my code, it doesn't belong to me.
But I'm sure you can work out the details, and will be glad to know
it can be done :-).

Clifford Heath, ManageSoft.