类似于如下格式数据就是xml格式的数据:
<data><country name="Liechtenstein"><rank updated="yes">2</rank><year>2023</year><gdppc>141100</gdppc><neighbor direction="E" name="Austria" /><neighbor direction="W" name="Switzerland" /></country><country name="Panama"><rank updated="yes">69</rank><year>2026</year><gdppc>13600</gdppc><neighbor direction="W" name="Costa Rica" /><neighbor direction="E" name="Colombia" /></country></data>#这里面 <data> </data> 就是root节点,里面相应是子节点,可以不停衍生下去# 作为节点有三个属性:tag(名称),attrib(属性),text(文本信息)# 如果节点没有文本信息,则要么节点直接结束,要么下前面有子节点"""注意:1.attrib属性中所谓的“键值”,键可以不加引号,值必须是字符串"""
xml格式文件,可以存放于txt文件中
xml模块就是对xml格式数据进行快捷操作
