[XML-SIG] DocumentFragment ??

kevin Thackray kevin.thackray at clarisys.fr
Tue May 4 09:21:12 EDT 2004


lo everyone,

I want to write a xml document from scratch but with a particular object 
model :
I have a class that handle the document creation (and futher 
validating), and other classes that handle various parts of my document

class MyDoc:
    newDoc = implementation.createDocument(None, "TheDoc", None)
    newDoc = Document()
    header = Header()
    newDoc.importNode(header, True)

class Header(DocumentFragment):
       def __init__(self):
            DocumentFragment.__init__(self)
            self.appendChild(Element("Autor"))

I raise this exception :
  File "/home/kevin/python/sdp/db2xml/DocTemplate.py", line 16, in __init__
    newDoc.importNode(header, True)
  File "/usr/lib/python2.3/xml/dom/minidom.py", line 1730, in importNode
    return _clone_node(node, deep, self)
  File "/usr/lib/python2.3/xml/dom/minidom.py", line 1807, in _clone_node
    if node.ownerDocument.isSameNode(newOwnerDocument):
AttributeError: 'NoneType' object has no attribute 'isSameNode'

I use it that way because, i don't want that my "agregate" classes knows 
the "agragator", ie. i don't wan't that my Header class knows the MyDoc 
classes!
If any body have any idea, any sample code would help me!

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/40a20eaa/kevin.thackray.vcf


More information about the XML-SIG mailing list