May 27, 2021 XML
XML documents form a tree structure that starts at the "root" and then extends to the "branches."
A tree structure is often referred to as an XML tree and can easily describe any XML document.
By adopting a tree structure, you can know all subsequent branches and branches starting at the root.
XML documents use simple, self-descriptive syntax:
The first line is the XML declaration. It defines the version of XML (1.0) and the encoding used (ISO-8859-1 - Latin-1/Western European character set).
The next line describes the root element of the document (like saying, "This document is a note"):
The next 4 lines describe the 4 child elements of the root (to, from, heading, and body):
The last line defines the end of the root element:
You can assume that from this example, the XML document contains a note that Jani wrote to Tove.
XML is excellently self-descriptive, do you agree?
The XML document must contain the root element. The element is the parent of all other elements.
Elements in an XML document form a document tree. The tree starts at the root and extends to the bottom of the tree.
All elements can have child elements:
Terms such as parent, child, and sibling are used to describe the relationship between elements. T he parent element has child elements. Child elements at the same level become compatriots (brothers or sisters).
All elements can have text content and properties (similar to HTML).
The image above represents a book in XML below:
The root element in the instance is the .lt;bookstore. All of the elements in the document are included in the .
There are 4 sub-elements of the element: slt;title,
In the following section, we'll cover the syntax of XML.