Representing whole XML documents John Cowan 18 Nov 2012 19:59 UTC

Currently, there is no way to encapsulate a complete XML document into
a Scheme program using SRFI 107.  A document consists of an optional
XML declaration, followed by zero or more PIs or comments, followed by
a single required element, followed by zero or more PIs or comments.

I propose a SRFI-108 style representation of whole documents using
#xml{...}, where ... represents the whole document (the exact syntax
depends on the outcome of SRFI 108).  This would be translated into the
S-expression ($xml-root version encoding standalone . children), where
"version", "encoding", and "standalone" are either string literals or #f.
Of course, the encoding would just be for documentation's sake: I am not
proposing that the Scheme reader actually switch encodings based on it.

By providing this feature, SRFI 107 macros would be able to generate
all the nodes of the complete XPath 1.0 data model.

John Cowan
In the sciences, we are now uniquely privileged to sit side by side
with the giants on whose shoulders we stand.
        --Gerald Holton