关于python读取xml文章很多,但大多文章都是贴一个xml文件,然后再贴个处理文件的代码。这样并不利于初学者的学习,希望这篇文章可以更通俗易懂的教如何使用python 来读取xml 文件。
[b]一、什么是xml?[/b]
xml即可扩展标记语言,它可以用来标记数据、定义数据类型,是一种允许用户对自己的标记语言进行定义的源语言。
abc.xml
[url=http://tools.jb51.net/code/xmljson]http://tools.jb51.net/code/xmljson[/url]
[b]在线格式化XML/在线压缩XML:[/b][b]
[/b][url=http://tools.jb51.net/code/xmlformat]http://tools.jb51.net/code/xmlformat[/url]
[b]XML在线压缩/格式化工具:
[/b][url=http://tools.jb51.net/code/xml_format_compress]http://tools.jb51.net/code/xml_format_compress[/url]