[bknr-devel] Problems with XML import/export, can't follow the tutorial

Frederico Muñoz fsmunoz at gmail.com
Tue Jun 1 18:40:00 UTC 2010


Hi Hans,

Thanks for the comments!


2010/6/1 Hans Hübner <hans.huebner at gmail.com>:
> I would stay with WRITE-TO-XML writing to a stream that defaults to
> *STANDARD-OUTPUT*.  If you like, add a trivial wrapper
> WRITE-TO-XML-STRING that returns an XML string instead.  Writing to a
> string consumes more memory and it would be stupid to first serialize
> into a string when one really wants to write to a stream.

Yes, good idea. I've added another macro that does exactly that.

> I do not think that a quoted list in Lisp syntax is expected in XML
> output.  I rather think that the current behavior that you describe is
> correct, and the XML deserializer should combine the individual
> elements that occur multiple times into one list.  The XML produced
> should, by default, try to serialize everything into proper XML and
> not use Lisp data formats.

I had the wrong approach, and what you say makes much more sense. I've
played around with exporting/importing, and by specifying adequate
parsers for the slots my example works as expected, in the sense that
the exported XML produces the correct values when imported.

At this stage the only other issue I can think of is the containment
parsing, which isn't being done (I mean, the containment slot isn't
being initialised to :* or :+ depending on the DTD, and so any
multi-element slot only contains the last element). It works correctly
when one explicitly sets the :container though, so the issue is only
with setting the initial value.

So, my plans at this stage are:

1) Tackle the containment issue
2) In the end of the changes update the tutorial
3) Eventually look at the "xml-update" file which is lingering there,
could be useful.

I'll come back when I have something worth seeing. As it is right now
I have successfully used XML impex to export and import objects,
almost in a datastore kind of way.

Regards,

Frederico




More information about the Bknr-devel mailing list