Python Online Training In Andhra Pradesh and Telangana
Opening Hours :7AM to 9PM
What is XML?
XML stands for "Extensible Markup Language". It is mainly used in webpages, where the data has a specific structure and is understood dynamically by the XML framework.
XML creates a tree-like structure that is easy to interpret and supports a hierarchy. Whenever a page follows XML, it can be called an XML document.
XML documents have sections, called elements, defined by a beginning and an ending tag. A tag is a markup construct that begins with < and ends with > . The characters between the start-tag and end-tag, if there are any, are the element's content. Elements can contain markup, including other elements, which are called "child elements".
The largest, top-level element is called the root, which contains all other elements.
Attributes are name–value pair that exist within a start-tag or empty-element tag. An XML attribute can only have a single value and each attribute can appear at most once on each element.
To understand this a little bit better, take a look at the following (shortened) XML file:
From what you have read above, you see that
<collection> is the single root element: it contains all the other elements, such as <genre>, or <movie>, which are the child elements or subelements. As you can see, these elements are nested.
Note that these child elements can also act as parents and contain their own child elements, which are then called "sub-child elements".
You'll see that, for example, the element contains a couple of "attributes", such as favorite title that give even more information!