Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Loading xml into CLOS objects

2 views
Skip to first unread message

Andy Chambers

unread,
Oct 17, 2007, 6:59:38 AM10/17/07
to
Hi,

How do lispers load xml into CLOS objects? I can think of a couple of
approaches but I'd really like to hear what others do. In particular,
how do you deal with situations when the xml you're dealing with
doesn't exactly match your object model?

Here's what I'm thinking about.

1) Read the document into a big sexp and define macros so you can just
execute it

2) Using something like S-XML....
a) make a tree like '(make-instance 'address-book
:entries (list (make-instance
'person
:name
"Andy"
:address
"Glasgow")
(make-
instance 'person
:name
"Fred"
:address
"Edinburgh")))
and apply it

b) make the objects as you go and return the top level object

Rainer Joswig

unread,
Oct 17, 2007, 7:20:00 AM10/17/07
to

Andy Chambers

unread,
Oct 17, 2007, 7:52:23 AM10/17/07
to
Fixing the example formatting...

'(make-instance 'address-book
:entries (list (make-instance 'person
:name "Andy"
:address "Glasgow")

(make-instance 'person

0 new messages