Whereas HTML can define a web page, XML doesn't actually define anything beyond what you want. It's a little confusing, and I was in the same place you are, so I'll try my best to explain:
Let's say you want to build an application that holds employee information. You don't want to use a full-blown database, and you want to be able to read the employee records manually. You might set up something like this:
- Code: Select all
<Name>Khalid al-Wahal Aj-Dubeen Ma A'Salaama</Name>
In this case, the root node is called Employees, and it holds all the other info. The numbers (00001, 00002, 00003) are employee IDs, used to uniquely identify each employee. Inside that, we have the name, salary, and position. Each new "level" is indented over. Applications can parse this easily, just as humans can.
XML doesn't "do" anything as you can see, but rather describes and contains data. You could just as easily create a cookbook, library directory, or calendar with XML.