[XML-SIG] DocumentFragment ??

kevin Thackray kevin.thackray at clarisys.fr
Tue May 4 10:16:16 EDT 2004


lo,

Thank you for your so quik reply.
I tried your sugestion about classe linking with still minidom

>
> I suggest using a containment relationship between Header and 
> DocumentFragment, instead of inheritance.
>
And i raise an exception at the same place :

class MyDocument:
    def __init__(self, demande):
        newDoc = implementation.createDocument(None, "CompteRendu", None)
        header = Header()
        newDoc.importNode(header.headerDoc, True)
        self.newDoc = newDoc
   
    def __str__(self):
        return str(PrettyPrint(self.newDoc))

class Header:
    def __init__(self):
        self.headerDoc = DocumentFragment()
        self.headerDoc.appendChild(Element("author"))

traceback :

Traceback (most recent call last):
  File "output.py", line 35, in ?
    doc = MyDocument(demande)
  File "/home/kevin/python/sdp/db2xml/DocTemplate.py", line 16, in __init__
    newDoc.importNode(header.headerDoc, True)
  File "/usr/lib/python2.3/xml/dom/Document.py", line 163, in importNode
    return importedNode.cloneNode(deep, newOwner=self)
TypeError: cloneNode() got an unexpected keyword argument 'newOwner'
***********

I wasn't sure if the problem was minidom+inheritance or juste trucky 
things with minidom?
Anyway, I will do the same thing that with standard DOM implementation 
(4Suite)
Thank you so much,

Regards,

Kevin Thackray
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kevin.thackray.vcf
Type: text/x-vcard
Size: 70 bytes
Desc: not available
Url : http://mail.python.org/pipermail/xml-sig/attachments/20040504/2295c8d7/kevin.thackray.vcf


More information about the XML-SIG mailing list