What Is XML?

Like HTML, XML is a markup language that can be used to represent complicated data in a hierarchical format. Because XML tags are user-defined, there's no limit to the kind of information you can embed into an XML document. Listing 10.1 shows a sample XML document.

Listing 10.1. A Sample XML Document
<?xml version="1.0">
<customer type="web">
  <firstName>Ian</firstName>
  <lastName>Young</lastName>
  <address>555 Downtown Ln</address>
  <city>Cincinnati</city>
  <zip>45023</zip>
</customer>

In this case, the XML document in Listing 10.1 describes a customer of a fictitious Web site. The data and attributes were made up, yet if you were to run an XML parser on Listing 10.1, it would correctly identify each attribute and piece of data.

Get Sams Teach Yourself ADO.NET in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.