using fromstring() with lxml prefixes

﹥>﹥吖頭↗ 提交于 2019-12-09 03:06:27

etree.fromstring('<style:style />') throws an error because <style:style /> is a small XML document that is not namespace-well-formed.

You have to declare the namespace in the document if you want to provide it as an argument to fromstring():

etree.fromstring('<style:style xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" />')
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!