Working with XML and the Open XML File Formats

XML (Extensible Markup Language) functionality has been available in various forms since Office 2000. It made its debut in the Office suite of applications in 1999 with relatively little fanfare, waiting there quietly until the release of Office 2003, where it was touted as one of the most significant improvements in Excel. Office 2003 came with many new XML capabilities and the promise of major changes in the way businesses would work with data. In addition to seamless exchange of data, XML promised easy analysis, dynamic reporting, and the ability to consume data from an untold number of external sources.

Unfortunately, XML has failed to find a place in the hearts of many Excel programmers. The problem is that many Excel programmers still look at XML as a solution to a problem that they haven't quite encountered yet. This is because much of the functionality offered by XML can be handled by existing technologies and processes that programmers are already comfortable with. In addition, most Excel developers don't live in environments where XML shines the brightest — environments where data is routinely exchanged between disparate platforms (such as the web). The reality is that most Excel programmers live in a world where the Office suite of applications and a few SQL Server databases are as diverse as it gets. The bottom line is that there has never been that one compelling reason to leave the comfort of existing technologies and processes to go to XML. That is, not until now.

Why has XML suddenly become so important? Two words: Open XML. With Office 2007, Microsoft gives XML a leading role by introducing the Open XML file format. These new file formats are XML-based, meaning that each Excel workbook you create in Office 2007 is essentially a group of XML documents. These XML documents are saved as a collection of parts, compressed into a Zip container, and given a file extension (for example, .xlsx, .xlsm, .xlam, and so on).

As illogical as Microsoft's move toward XML may seem, the decision to bet on XML is a fairly rational one. An XML-based Office will be able to move into an increasing number of environments as XML becomes a widely adopted standard. An XML-based Office can be integrated with much wider array of XML-capable software and web-based applications. An XML-based Office opens up new opportunities for programmers to develop applications that revolve around the Office suite.

With this move toward XML, Microsoft takes a huge step toward making Excel spreadsheets universal widgets that can be integrated into almost any application or web-based solution. Within the next few years, XML-based solutions will start materializing everywhere until XML becomes a part of the Excel developer's everyday vernacular.

So as Microsoft pushes us all into a new realm of development, it's important to start to get a grasp of the XML technology. In this chapter, you will get a firm understanding of XML as it pertains to both Excel and the new Open XML file formats. That being said, it's important to note that the goal of this chapter is not to make you an expert XML developer. Indeed, the topic of XML is a robust one that cannot be fully covered in one chapter. The goal of this chapter is to give you a solid understanding of all the aspects of XML you will need to be familiar with when working with XML in Excel.

0 0

Post a comment