首页IT科技python协程用法(python XML数据是什么)

python协程用法(python XML数据是什么)

时间2025-05-04 10:58:56分类IT科技浏览5378
导读:1、概念...

1             、概念

XML 格式的数据既便于机器读取            ,也便于人工读取             。

xml 格式说明:

Tag: 使用<和>包围的部分;

Element:被Tag包围的部分                   ,如 2003      ,可以认为是一个节点      ,它可以有子节点;

Attribute:在Tag中可能存在的 name/value 对                   ,如示例中的 title="Enemy Behind"            ,一般表示属性                  。

2                  、实例

<?xmlversion="1.0"encoding="UTF-8"?> <collectionshelf="NewArrivals"> <movietitle="EnemyBehind"> <type>War,Thriller</type> <format>DVD</format> <year>2003</year> <rating>PG</rating> <stars>10</stars> <description>TalkaboutaUS-Japanwar</description> </movie> <movietitle="Transformers"> <type>Anime,ScienceFiction</type> <format>DVD</format> <year>1989</year> <rating>R</rating> <stars>8</stars> <description>Aschientificfiction</description> </movie> <movietitle="Trigun"> <type>Anime,Action</type> <format>DVD</format> <episodes>4</episodes> <rating>PG</rating> <stars>10</stars> <description>VashtheStampede!</description> </movie> <movietitle="Ishtar"> <type>Comedy</type> <format>VHS</format> <rating>PG</rating> <stars>2</stars> <description>Viewableboredom</description> </movie> </collection>

以上就是python XML数据的介绍      ,希望对大家有所帮助      。更多Python学习指路:Python基础教程

创心域SEO版权声明:以上内容作者已申请原创保护,未经允许不得转载,侵权必究!授权事宜、对本内容有异议或投诉,敬请联系网站管理员,我们将尽快回复您,谢谢合作!

展开全文READ MORE
python的xml(python ElementTree解析的方法) python中匿名函数lambda(python匿名函数的好处)