What's the difference between HTML and XML?
I'm well familiar with HTML, but my knowlege about XML very limited.
In old-fashioned HTML we were forced to write something like:
<div>
<p>Hi</p>
</div>
In other words, in HTML we have limited set of tags.
Unlike XML, where we can specify our own tags:
<letter>
<to>John</to>
<from>Mike</from>
<date>01.01.2017<date>
<contents>Hi!</contents>
</letter>
However, now I have Chrome installed on my computer, and it's history page looks like this:
<body>
<history-app>
<history-router>...</history-router>
<history-toolbar>...</history-toolbar>
<div>
<history-side-bar>...</history-side-bar>
<iron-pages>...</iron-pages>
</div>
</history-app>
</body>
As you can see, there are a lot of tags, which are not exist in HTML.
The same case with AngularJS, where we can create our own custom tags.
So I'm a bit confused is there any real difference between XML and HTML in modern times.
Also, maybe (I'm not sure, because as I said, my knowledge about XML is very limited), XML provides some rules (schemes) about how tags can and can not be organized. For example, I have some scheme called "Standard Letter", and according to this scheme, tag <letter>
should always contain tags <to>
and <from>
, and moreover, <to>
must be the first. Hm... but HTML also has such requirements. For example, <table>
always must have <tr>
inside, and <td>
inside <tr>
.
Previously, I've asked about difference between DocBook and HTML. But I've also decided to reformulate it in a new manner, as described above (XML vs. HTML).