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
In article <························@y27g2000pre.googlegroups.com>,
Andy Chambers <··············@googlemail.com> wrote:
> 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
Seen this?
http://www.agentsheets.com/lisp/XMLisp/