You can try the XsdToHaskell tool in HaXml. It might not work perfectly by itself, but with a little cleanup it'll probably save you some time.

I've also used TemplateHaskell to generate XML serializers for data declarations. If you write your own code generator, you can be as generic and customized as you need.

On Mon, May 30, 2016 at 3:04 AM, Johannes Waldmann <johannes.waldmann@htwk-leipzig.de> wrote:
Dear Cafe,

I have a legacy XML schema, and some Haskell data declarations.
I want to map bidirectionally between XML documents and data.

I absolutely cannot change the schema. I could change the data
declarations, but it would not help much, since I don't think
there is any formĀ  of declaring data that would allow me
to derive the transformations generically.

So, I have a mess of ad-hoc transformations.
What could be done about this?
I think I need "generic with customization".

More detail: https://github.com/jwaldmann/haskell-tpdb/issues/16

Comments appreciated.

- J.W.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe