From the course: Effective Serialization with Python

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

XML serialization

XML serialization - Python Tutorial

From the course: Effective Serialization with Python

Start my 1-month free trial

XML serialization

- [Instructor] XML has been around for a long time. It's glory days are over, but I can guarantee that at one point or another, you will work with XML. Let's have a look at an example document. XML is built as a tree, the root of this tree is the metric element. Each element or node has a tag, in this case, this is the metric tag. In this case, this is the time tag. It can has data, for example, the data here is this part of the data. The data name is memory and the data value is 42.7. All the data is text only. It can have possible properties, for example, here in the label, there are two properties, the key which is host and the value, which is prod7. And there are possible child nodes. So the metric has time, name, value and labels as child nodes. And the labels has label as child nodes, two of them. There are two ways to work with XML. One is called DOM, for document object model, and this is everything in…

Contents