n today’s world, electronic data transfer has become an important aspect of our everyday
life. When you withdraw money from an ATM, make credit card purchases, pay your utility
bills on the Web, look up a news channel for current world happenings, look up an online map
for driving directions, and so on, the data flows in electronic format between various applica-
tions. These applications have been developed by different vendors at different times without
any prior agreement on the format of data transfers.
Many companies have set up their own standards for communication with business
partners. These are generally binary based, not human-readable, and require extra effort to
implement. These communication protocols never became world standards because of their
complexities. What people really wanted was a standard that everybody across the globe
would accept as a common protocol for data transport. That’s where Extensible Markup
Language (XML) was born. XML solves most of the problems faced in the existing protocols
of data transport.
XML is rapidly becoming the de facto industry standard for data transport. Nowadays
XML is used everywhere: for setting your application configurations, transporting data across
machines, storing data in databases, invoking business methods on remote servers, and so on.
These days you will hardly find any recently developed application that does not use XML.
Thus, with the widespread use of XML in software applications, you need to learn how to
create, process, and successfully use XML documents for data interchange. This chapter gives
you a brief overview of XML, its syntax, and namespaces. You’ll also be introduced to the Doc-
ument Type Definition (DTD) and XML Schema standards, which play a key role in creating
valid XML documents. You’ll begin by first understanding the need for XML.
Why Use XML?
The Web is heavily based on the use of HyperText Markup Language (HTML). HTML defines
several tags—for example,
—that describe how to render the docu-
ment’s contents on the browser. However, these tag elements do not usually convey any
meaning about the data embedded in the document but instead just describe how the data
should be presented. XML solves this problem by allowing the document creator to devise
meaningful tag names that express the purpose of the embedded data rather than how it
should be presented.