Xml
XML is a protocol that implements the exchange of data between different languages or programs, in the following format
<data> <country name="Liechtenstein"> <rank updated="Yes">2</rank> <year>2023</year> <gdppc>141100</gdppc> <neighbor Direc tion="E"Name="Austria"/> <neighbor direction="W"Name="Switzerland"/> </country> <country name="Singapore"> <rank updated="Yes">5</rank> <year>2026</year> <gdppc>59900</gdppc> <neighbor Direct ion="N"Name="Malaysia"/> </country> <country name="Panama"> <rank updated="Yes">69</rank> <year>2026</year> <gdppc>13600</gdppc> <neighbor Direc tion="W"Name="Costa Rica"/> <neighbor direction="E"Name="Colombia"/> </country></data
format of XML
Characteristics of XML
- The label starts with a < character, the <data> in the example above
- Ignore spaces
- tags can be nested with each other, for example, country is his child tag.
Python Basic XML and request