我对 odfpy 和 Python 3 有疑问。我尝试在 Opendocument 文本文件中复制现有表。我无法从原始表格中获取样式信息。这是我的代码:
# templateTable is a table.Table that has to be copied
for childNode in templateTable.childNodes:
if 'style-name' in str(childNode.attributes):
# the next command fails and the python interpreter tells me
# 'style-name' is not in list
style = childNode.getAttribute('style-name')
欢迎帮助!