Fwd: [XML-SIG] xmlpickle.py ?!

Jim Fulton jim@digicool.com
Tue, 08 Aug 2000 09:58:10 -0400


"M.-A. Lemburg" wrote:
> 
> Jim Fulton wrote:
> >
(snip)
> The design doesn't look clear to me, e.g. it seems as if you
> are first pickling an object using the standard Python pickle
> mechanism and the pass the pickled string to the XML converter.
> Is that so ?

Yes.

>  ...I think I'd rather like to go the direct way.

Why? Why is this a goal? By leveraging pickle or cPickle, 
you can let them do alot of heavy lifting, rather than starting
from scratch. In particular, I'd bet $.05 that cPickle+ppml
is faster than a "direct" solution.

It *was* a goal for me to work from pickles because it allowed
me to do database binary<->xml conversion *without* creating
objects in memory or even having to have the classes around.
This is handy in alot of cases, for example, for ZODB database
management and making it easy for humans to read pickles.
I don't see the harm in separating the pickling and 
xml steps.

> Hmm, I should really try to get the module run outside of
> Zope... for now I've just been looking at the code.

It needs to be modified to work with SAX. ppml works with xyap
which could easily be modified to work with a sax parser.
 
(snip)
> > > like about ppml.py's approach is that it pickles e.g.
> > > integers to a binary format.
> >
> > Nah:
> >
> > <pickle> <int>123</int> </pickle>
> 
> Ah, I was seeing all these binary formatting APIs in ppml.py
> especially for 64-bit ints. Looks as if these are not used anywhere
> in the code though...

ppml can convert to and from binary pickles.
 
Jim