[Zope] Bug "Export Product and inheritance" (2). Any more description about XML export format?

Thierry Nabeth Thierry.Nabeth@insead.fr
Sun, 21 Jan 2001 22:24:32 +0100


Hello,

I am still struggling to find a way to solve the bug (even manualy)
relate to exporting a package in which a class inherits from a class
of another package.

Do you have any more details about the Import XML format ?
I want to see if I can edit manually this file in order to solve
the fact that I lost inheritance from one class to another class
that is defined in another package.




For instance in the file
.../OFS/XMLExportImport.py

we have:

def save_record(parser, tag, data):
    file=parser.file
    write=file.write
    pos=file.tell()
    file.seek(pos)
    a=data[1]
    if a.has_key('id'): oid=a['id']
    oid=ppml.p64(string.atoi(oid))
    v=''
    for x in data[2:]:
        v=v+x
    l=ppml.p64(len(v))
    v=oid+l+v
    return v

def importXML(jar, file, clue=''):
    import Shared.DC.xml.pyexpat.pyexpat
    pyexpat=Shared.DC.xml.pyexpat.pyexpat
    if type(file) is StringType:
        file=open(file)
    outfile=TemporaryFile()
    data=file.read()
    F=ppml.xmlPickler()
    F.end_handlers['record'] = save_record
    F.end_handlers['ZopeData'] = save_zopedata
    F.start_handlers['ZopeData'] = start_zopedata
    F.binary=1
    F.file=outfile
    p=pyexpat.ParserCreate()
    p.CharacterDataHandler=F.handle_data
    p.StartElementHandler=F.unknown_starttag
    p.EndElementHandler=F.unknown_endtag
    r=p.Parse(data)
    outfile.seek(0)
    return jar.importFile(outfile,clue)


Would it be possible to have a couple of lines of comments ?

Thank you


Thierry Nabeth
INSEAD CALT
http://www.insead.edu/CALT/



Note:
This BUG makes almost impossible all serious reuse of package
in Zope. (if you want to use inheritance, since you can not
get newer version of the package you reuse).
I am very surprised that nobody did not give any comment to my previous
message !!!