Chapter IV.4. Working with XML

In This Chapter

XML is the gold standard for working with data in modern software application development. XML, short for eXtensible Markup Language, is a markup language like HTML, which is the language used to create Web pages. In HTML, you use a set of predefined markup tags, such as <html> and <body>. The tags use attributes to further define the markup, such as <body background="white">.

XML uses tags and attributes like HTML does. However, unlike in HTML, you define what tags and attributes to use. XML is used to describe data, so you make up your own tags and attributes to define the data. For example, an XML file could use these tags to describe data about a book collection:

<Books>
<Book>
<Author></Author>
<Title></Title>
<Book>
</Books>

The XML file might use these tags because no predefined rules specify the tags you use. You decide which ones to use. As long as you declare which tags you want to use and then use them consistently, anyone can understand how to read your XML file. As you can see, XML is a powerful language for describing data because XML files

  • Are plain-text files that you can edit and read in any text editor

  • Include a schema definition that identifies all the elements and attributes to use to describe data

  • Can transform into other languages, such as HTML

Microsoft has wholeheartedly embraced XML, and Visual Studio has several intelligent editors for creating and manipulating XML files. The .NET Framework has an entire namespace ...

Get Visual Studio® 2008 ALL-IN-ONE DESK REFERENCE FOR DUMMIES® 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.