What is XML?
Pronunciation:
/ˌeksemˈel/
noun
COMPUTING
- a metalanguage which allows users to define their own customized markup languages, especially in order to display documents on the Internet.
Basically XML doesn’t do anything. Its markup language – eXtensible Markup Language. It is similar to HTML but not quite so. View it like if you what to store some data, easy (this is questionable) for reading and understanding, to transfer data between apps, between platforms and etc.
Here is some XML Example:
1 2 3 4 5 6 7 8 9 |
<movie> Easy blog <year> 2018 <genre> Comedy </genre> </year> </movie> |
Syntax:
It has one root element, in our case is the root element, and it has child elements like <year>, and <genre>. Every element must contain closing tab like </this>, or in our example </movie>, so the end of that element is known. If it has only one line element it will look like this <this (some context) /> and its called self closing tab. Every element can contain text, attributes, other element and combination of above.
XML Tags are key sensitive.
XML Comment example:
1 |
<span class="com"><!----- comment -----></span> |
- Comments cannot appear before XML declaration.
- Comments may appear anywhere in a document.
- Comments must not appear within attribute values.
- Comments cannot be nested inside the other comments.