[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Representing whole XML documents

This page is part of the web mail archives of SRFI 107 from before July 7th, 2015. The new archives for SRFI 107 contain all messages, not just those from before July 7th, 2015.



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  cowan@xxxxxxxx  http://ccil.org/~cowan
In the sciences, we are now uniquely privileged to sit side by side
with the giants on whose shoulders we stand.
        --Gerald Holton