
Mattias Bengtsson
On Wed, 2007-12-19 at 15:06 +0000, Jon Fairbairn wrote:
I think that would be the job of something like HaXml or HXT, and there are plenty of good people working on them. To clarify, what these types enforce is something stronger than an XML DTD, more like the SGML DTD of html (and as I write this I am inclining myself further towards making the document tree types fit the common subset); it enforces the restrictions that are only expressed in prose in the xhtml1.0 standard. You could think of it as enforcing a schema (that the w3c didn't provide).
It seems that they did actually[1].
Thanks for finding that (I do hate the way that the W3C issues proper formal definitions of things but makes the informal one the normative one); I can use it to check attribute types and so on. Does it enforce the nesting restrictions (described in app. B of the xhtml1 dtd)? Looking through it with little knowledge of schemas, I can't see that it does.
Making a program for generating ADT's and combinators from XML schemas to provide type safe XML is something i'd very much like to do someday.
It would be a good thing to do, though not something I'm thinking of just now (a bit too much for me at the moment).
One thing i'm uncertain of is whether supporting namespaces would be a problem or not. It would be a shame to have a bunch of generated XML-standards in Haskell that can't be used together (ie. embedding MathML or SVG in XHTML).
Yes. I'd like the document tree in the typeful HTMLs library to be compatible with such things, but again, I'm not up to doing the big concept stuff. -- Jón Fairbairn Jon.Fairbairn@cl.cam.ac.uk