#lang scribble/doc @(require scribble/manual) @title{xml-maker} A simple XML maker and functional XHTML document maker. It makes fully valid XML documents (and hopefully valid XHTML (I don't check if the properly allowed tags are nested yet)) and returns them as a utf-8 encoded string (with utf-8 encoding specified in the XML.) That allows you to create complete documents, and if there's an error, send an error to the remote requester instead of a broken document. See examples/ for how it works. pretty much @scheme[(xml:element 'a (xml:elemnt 'b 'c 42 (xml:element 'd "e")))] for general XML, but @scheme[define-named-elements] is there for people who want to generate specific XML grammars themselves, such as the XHTML I threw together: @scheme[(require synx/xml-writer/xhtml)] you can @scheme[(document (build-head "title" "style.css") (p "This is the current date: " (current-date)))]. If you avoid pitfalls like putting non-block tags in the body, you can actually produce HTML 1.1//STRICT documents with this library! If you want to make your own grammar, I've been leaning towards the strategy of making a function for each tag name that itself produces the complete tag. Haven't quite figured how to take an XML document definition and automatically produce a module of such functions from it, but that is a distinct possibility. For now, @scheme[(define-named-elements foo bar a b c) (display (foo (bar "baz" (a (b 23) (c 42)))))] is what is setup.