xmindltd / xmind-sdk-python

MIT License
428 stars 179 forks source link

AttributeError: ownerDocument from the example.py #31

Closed SeekPoint closed 5 years ago

SeekPoint commented 5 years ago

C:\ub16_prj>python yk-demo-xmind-sdk.py Traceback (most recent call last): File "yk-demo-xmind-sdk.py", line 19, in t1=TopicElement() # create a new element File "C:\Users\andyy\AppData\Local\Programs\Python\Python37\lib\site-packages\xmind\core\topic.py", line 39, in init self.addIdAttribute(const.ATTR_ID) File "C:\Users\andyy\AppData\Local\Programs\Python\Python37\lib\site-packages\xmind\core__init__.py", line 274, in addIdAttribute self._node.setAttribute(attr_name, id) File "C:\Users\andyy\AppData\Local\Programs\Python\Python37\lib\xml\dom\minidom.py", line 741, in setAttribute attr.ownerDocument = self.ownerDocument AttributeError: ownerDocument

C:\ub16_prj>

yuehlin1 commented 5 years ago

try this t1 = TopicElement(ownerWorkbook = w) instead of t1 = TopicElement()

SeekPoint commented 5 years ago

it works, @sqohapoe thanks