==============================================================================
The SXP package - Simple XML parser
==============================================================================

sxp:parse
---------
(sxp:parse buffer)

 Parses a string buffer (or a stream) containing an XML document, and returns
 a parsed tree in  memory in the form of nested lists of the form:
    (element-type attributes-plist children...) 

 It basically converts a string containing
     <elt alt1="val1" alt2="val2"> child1 child2 </elt>
 into a returned recursive list:
     (elt (:alt1 "val1" :alt2 "val2") child1 child2)
 Terminal Elements are strings, thus corresponding to character data

 This parser is targeted at data representations, not full text and thus
 has the following limits (that could be lifted at a later date):
  - only 8bit ISO-8859-1 encoding (not UTF-8)
  - parses a complete string in memory
  - does not handle entities
  - does not validate
  - lax parsing: can accept data formed of characters that would be rejected
    by a strict XML parser
 Text contents are converted to string objects
 Comments, Processing Instructions, and DTDs are discarded

e.g:
 (sxp:parse "<book format=\"A5\"><title>SML reference manual</title></book>")
 ==>  (book (:format "A5") (title () "SML reference manual"))

 (sxp:parse "<supported-formats><jpeg/><gif/><png/></supported-formats>")
 ==>  (supported-formats () (jpeg ()) (gif ()) (png ()))

 (sxp:parse "<author>Colas <name>Nahaboo</name></author>")
 ==>  (author () "Colas " (name () "Nahaboo"))

sxp:print
---------
(sxp:print tree [stream])

 The opposite of sxp:parse: from a nested list representation in memory,
 outputs an XML representation on the stream (default: standard output)

 (sxp:print '(book (:format "A5") (title () "SML reference manual")))
 prints on stdout:
 "<book format=\"A5\"><title>SML reference manual</title></book>"

sxp:eval
--------
(sxp:eval tree prefix)

 Performs parsing of the tree via a simple mecanism: each node of the type:
 (element-type attributes-plist children...) is "evaluated" by executing the
 call to:
    (prefix:element-type list-of-evaluated-children attributes...)
 Implementing a parser is thus defining all the necessary prefix:element-type
 functions with simple defuns

e.g: 
    (sxp:eval '(book (:format "A5") (title () "SML reference manual")) "my")
    Will evaluate the expression:
    (my:book (list (my:title (list "SML reference manual"))) :format "A5")
    That you will have to implement as:
    (defun my:book (children &key format)
	   ...
    )

==============================================================================

HISTORY of this document (xml-sxp.txt)
========================

by Colas Nahaboo <colas@sophia.inria.fr>

v1.0 1998-Nov-30
    First release: non validating, sxp:parse, sxp:print, sxp:eval
