spacer
Yehuda Shiran December 25, 2001
Justifying XML
Tips: December 2001

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Linux Subscriptions Paying Off for Red Hat
OpenVAS Charts Its Own Forked Course
A Linux Year in Review: Sun's Very Big Buy
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:

<H1>MyDvd Rental Store on the Web</H1>
<H2>Periodical Sales Report</H2>
<P>Sales report for January, February, and March of 2001</P> 
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:

<heading>MyDvd Rental Store on the Web</heading>
<subhead>Periodical Sales Report</subhead>
<description>Sales report for January, February, and March of 2001</description> 
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 H1 tag to be larger than text within an H2 tag. XML, on the other hand, has no notation of format whatsoever. You need to use XSL (Extensible Stylesheet Language) or XSLT (XSL Transformation) to display XML information on the Web. XML and XSLT constitute a dynamic and flexible system for handling data and presentation.


People who read this tip also read these tips:

Look for similar tips by subject:

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

webref The latest from WebReference.com Browse >
Email Marketing Terms to Know · Search Engines 101: Paid Vs. Natural Search · Web 2.0 Tools
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Connecticut Town Lays Groundwork for Merged School, Municipal VoIP Network · Case Study: Leveraging Next-Gen Wi-Fi to Transform Healthcare · Tripp Lite Announces Five New Surge Suppressors