|
December 25, 2001 Justifying XML Tips: December 2001
Yehuda Shiran, Ph.D.
|
|
The proliferation of XML to many Web applications can be explained, among other factors, by its added information compared with HTML. HTML has become a standard for presenting information on the Web. HTML tags, on the other hand, do not contain any information about the data. Look at the following HTML page's top portion:
In this example, "MyDvd Rental Store on the Web" is a large heading (H1), "Periodical Sales Report" is a smaller heading (H2), and the rest is a paragraph (P). When displayed in a Web browser, you can easily understand these three pieces of information. The size and location of each piece tells you what the author had in mind when writing the HTML page. XML, on the other hand, explicitly defines the data. Here is the same example in XML:
Information in HTML is usually stored in its final form. If you need to present the same Web page in two different way, you need to create two different HTML pages, each storing the same data. Information in XML, on the other hand, can be presented in a multitude of ways for different target audiences. XML parsers are used to interpret the data.
Another difference between HTML and XML is that unlike HTML, XML provides no formatting information. In HTML, the tag name discloses its format. For example, you expect text within an
People who read this tip also read these tips: Look for similar tips by subject: |