A 5-Minute Crash Course in XML
Explore the structure of XML including elements, attributes, namespaces, and text content. Understand how XML documents are formed, how namespaces work, and how to identify valid XML syntax. Gain the foundational knowledge needed to work with XML data in Python 3.
We'll cover the following...
If you already know about xml, you can skip this section.
XML is a generalized way of describing hierarchical structured data. An XML document contains one or more elements, which are delimited by start and end tags. This is a complete (albeit boring) xml document:
① This is the start tag of the foo element.
② This is the matching end tag of the foo element. Like balancing parentheses in writing or mathematics or code, every start tag must be closed (matched) by a corresponding end tag.
Elements can be nested to any depth. An element bar inside an element foo is said to be a subelement or child of foo.
The first element in every xml document is called the root element. An xml ...