Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/333.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
python中的Expat-xml解析器_Python_Xml Parsing_Expat Parser - Fatal编程技术网

python中的Expat-xml解析器

python中的Expat-xml解析器,python,xml-parsing,expat-parser,Python,Xml Parsing,Expat Parser,在python中使用expatxml解析器时,如何让它将解析后的xml数据存储在字符串、文件或任何数据结构中。请告诉我如何解析和使用xml数据的节点。既然可以使用xml.etree。[c]ElementTree,为什么还要使用expat解析器这样的低级接口?它为您创建一个元素节点树。元素具有标记、文本和尾部属性,并包含将属性名称映射到值的dict和子元素列表 请看一下xml.etree.ElementTree的Python文档。您阅读了吗?是的!我正在使用它,但是如何以某种格式存储输入?不要炫耀

在python中使用expatxml解析器时,如何让它将解析后的xml数据存储在字符串、文件或任何数据结构中。请告诉我如何解析和使用xml数据的节点。

既然可以使用xml.etree。[c]ElementTree,为什么还要使用expat解析器这样的低级接口?它为您创建一个元素节点树。元素具有标记、文本和尾部属性,并包含将属性名称映射到值的dict和子元素列表


请看一下xml.etree.ElementTree的Python文档。

您阅读了吗?是的!我正在使用它,但是如何以某种格式存储输入?不要炫耀你的谷歌搜索技能。仔细阅读我的问题@哨兵:他为什么要读像2.5文档这样的老东西?顺便说一句,上一个非安全版本是2.5.4