What is XML

XML is an accepted standard that enables exchange of data between different applications. XML is a markup language, just like HTML is a markup language.

XML uses tags to define elements within a document. XML tags define the document's structural elements and the meaning of those elements. Unlike HTML tags, which specify how a document looks or is formatted, XML can be used to define the document structure and content. Consequently, XML separates a document's content from its presentation.

Following is a very simple XML file that contains data from an e-mail message.

<?xml version="1.0" encoding="UTF-8"?> <message>

<to>Bill Smith</to> <from>Mark Jackson</from> <subject>Meeting date</subject>

<body>The meeting will be at 8:00 a.m. on Tuesday</body> </message>

When the file is viewed in Internet Explorer, the browser displays it as a structured document (as shown in Figure 4-3).

All the files in this section are available on the companion CD-ROM.

Figure 4-3: Internet Explorer displays XML files in a structured format.

Unlike HTML, the XML specification does not specify the tags themselves. Rather, it provides a standard way to define tags and relationships. Because there are no predefined tags, XML can be used to model virtually any type of document.

The information in this chapter is an admittedly cursory overview of XML. The fact is that XML can be extremely complex. Many books are devoted entirely to XML.

The three sections that follow consist of simplistic examples to give you a feel for how Excel handles XML.

0 0

Post a comment