From: Andy Chambers
Subject: Loading xml into CLOS objects
Date: 
Message-ID: <1192618778.696857.107990@y27g2000pre.googlegroups.com>
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

From: Andy Chambers
Subject: Re: Loading xml into CLOS objects
Date: 
Message-ID: <1192621943.080927.256130@z24g2000prh.googlegroups.com>
Fixing the example formatting...

'(make-instance 'address-book
      :entries (list (make-instance 'person
                         :name "Andy"
                         :address "Glasgow")
                     (make-instance 'person
                         :name "Fred"
                         :address "Edinburgh")))
From: Rainer Joswig
Subject: Re: Loading xml into CLOS objects
Date: 
Message-ID: <joswig-0EBD53.13200017102007@news-europe.giganews.com>
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/