
25 Apr
2010
25 Apr
'10
7:53 a.m.
All of the ideas mentioned so far have already been implemented in some form on hackage. It's worthwhile to browse through and look them over. The classic approach is in the html and xhtml packages. They are basically Jasper's combinator idea, together with Miguel's class idea. There are a few other approaches, but I like your ideas the best. One problem is that these are based on plain String, so it's easy to generate invalid output due to problems with entities and encodings. Also, one would hope that the type system could constrain the document structure to conform to the DTD. But both of those turn out to add a lot of complexity. See the haxml and hxt packages, and Henning's wrapper for them xml-basic, for some ideas. Regards, Yitz