Generate API implementations from XML

Hi, as written in my previous mail, I'm implementing a dbus interface in Haskell. The interface definition is given in XML[1] according to a given dtd[2]. For every dbus method one need to invoke[3] export :: Client -> ObjectPath -> [Method] -> IO () What would be a good way to autogenerate all this export calls and Method instances? All necessary informations are given in the dbus spec xml. One could write a script that writes Haskell code. Or one could use template haskell that reads the xml file at compile time? Or? Do you know other examples to learn from that autogenerate Haskell code from interface definitions? Thank you, Thomas Koch [1] http://code.metager.de/source/xref/freedesktop/xdg/specs/secret-service/org.... [2] http://standards.freedesktop.org/dbus/1.0/introspect.dtd [3] http://hackage.haskell.org/package/dbus-0.10.9/docs/DBus-Client.html#v:expor...
participants (1)
-
Thomas Koch