Datasheet

A parser is a program that analyzes and verifies the syntax of the coding of a programming language.
An XML- capable browser parses XML code to ensure that is syntactically correct. As already
mentioned, one parser function is to ensure that all starting and ending tags exist, and that there is
no interlocking of XML tags within the document. Interlocking implies that a new tag of the same
type, such as
<city>, cannot be started, until the ending tag of the previous city (</city>), has
been found.
In a browser, the XML document looks as shown in Figure 1-3. The callouts in Figure 1-3 show that in
addition to being flexible for a web pages programmer, XML is even flexible to the end user. End users
are unlikely to see an XML document in this raw state, but Figure 1-3 helps to demonstrate the flexibility
of XML.
Figure 1-3: A simple sample XML page
The primary purpose of HTML is for display of data. XML is intended to describe data. XML is the data
and thus describes itself. When HTML pages contain data, they must be explicitly generated. For every
web page weather report written in HTML, a new HTML page must be created. This includes both the
weather report data and all HTML tags. When regenerating an XML-based weather report, only the data
is regenerated. Any templates using something like XSL remain the same. And those templates are prob-
ably only downloaded once. The result is that XML occupies less network bandwidth and involves less
processing power.
XML is also a very capable medium for bulk data transfers that are platform and database independent.
This is because XML is a universal standard. In short, XML does not do as much processing as HTML
does. XML is structure applied to data. Effectively XML complements HTML rather than replaces it.
XML was built to store and exchange data; HTML is designed to display data. XSL, on the other hand, is
designed to format data.
<city> tree is closed
<temperature> tree is closed
All trees opened
5
What Is XML?
04_791202 ch01.qxp 10/6/06 10:59 AM Page 5