(process-xml-data #p"/home/norman/bsp.xhtml")
(process-xml-data (data &key (table *namespace-table*) (default *default-package*) (upcase-tagnames t) (upcase-attributes t) (attribute-reader 'identity) (body-reader 'identity) (evaluator 'eval)))
opens data parses xml-content and process data according to evaluator.
data | The stream, pathname or string containg the xml. |
table | An alist specifing a xml-namespace to cl-package mapping. The function or macro belongin to a tagname is looked for in a packaged specified by this mapping. See also *namespace-table*. |
default | A package used for looking up functions, if no other cl-package was found by consulting table. |
upase-tagnames | As xml is case-sensitive and cl is not. You may want to control whether tagnames are upcased before converting them to function or macro names. |
attribute-reader | A package used for looking up functions, if no other cl-package was found by consulting table. |
body-reader | A function used to read attributes. You may want to change this eg. to #'read or a function which split multiple arguemnts into a list. |
evaluator | After all tagnames, attributes and body-elemts are converted the resulting lisp is interpreted as a lisp-programm. This argument specifies how this is to be done. |
(parse s)
Parse parses a stream containing xml and returns an xmls compatible list or NIL (if the stream does not contain valid xml).
By default parse uses xmls. You may override this by redefining parse.
s | An input-stream which yields the xml data to parse. |
(read-to-xmls-sexp input-stream)
Reads a string or stream (or a pathname designating a file) into an xmls compatible sexp. It mainly is a wrapper for parse.
s | Should be a stream, a pathname or a literal string containg valid xml. |
I am not aware of any implementation dependencies. However - if you find some: Please let me know.
The code was developed on sbcl on linux(debian) so it is to work at least on this platform.
If you call (by processing your xml-data) a function which doesn't exist you will experience errors.
You may want to have a look at the source code. There is an example on how to setup default functions for certain tagnames (in this example all tagnames of xhtml).
By default all arguments and keyword arguments are supplied as specified in the XML-data - as objects of type string.
You may want to change this to allow eg. For inclusion of numbers or lists of strings. To do so, change the attribute-reader and body-reader arguments of process-xml-data