On Mon, Jan 16, 2017 at 04:04:18PM +0000, dean wrote:
> I tried this on an xml file and it seems ideal re separating the tags and
> data for processing
> (in "fl.xml" (until (eof) (prinl (read))))
> The input is stopping abruptly when I hit an isolated closed paren though
'read' cannot be used to parse an XML file, because it expects Lisp syntax.
> I'm just wondering how best to get around this
"@lib/xm.l" or "@lib/xml.l" are for that.
The function 'xml' slurps in a whole XML tree:
: (load "@lib/xm.l")
: (in "fl.xml" (and (xml?) (xml)))
-> (...) # Get s-expr representing the XML
: (pretty @)
# Get pretty-printed output of the structure
You can then operate on the s-expr with all the list manipulation functions.
And/or use 'body' and 'attr' for convenience.