Introducing XML

Although the Hypertext Markup Language (HTML) is great for describing how a Web page should be displayed in a browser, the language isn’t designed to communicate anything about the contents of a document. For example, telling Internet Explorer to display a worksheet as an HTML table tells you nothing about the data shown on a Web page. When you save your worksheet data to an XML document, however, Excel annotates the data with tags describing which program generated the data, the name of the worksheet, and the data that belongs in each cell. With that information, Excel, or another spreadsheet program that understands XML data, can read in your worksheet data and retain your original meaning.

Although a full discussion of XML is beyond the scope of this book, the following bit of XML code shows how to identify an Excel workbook in XML:

<?xml version="1.0"?>

<Workbook xmlns="urn:schemas-microsoft-com:office:
spreadsheet"    xmlns:o="urn:schemas-microsoft-com:
office:office" xmlns:x="urn:schemas-microsoft-com:
office:excel"  xmlns:ss="urn:schemas-microsoft-
com:office:spreadsheet" xmlns:html="http://www.
w3.org/TR/REC-html40">

Also, XML can identify rows and cells within the spreadsheet, as in the following example:

   <Row>
    <Cell><Data ss:
Type="String">Atlantic</Data></Cell>
    <Cell><Data ss:Type="Date">1/1/2007</Data></Cell>
    <Cell><Data ss:Type="Number">2007</Data></Cell>
    <Cell><Data ss:
Type="String">January</Data></Cell>
    <Cell><Data ss:Type="Number">1</Data></Cell>
    <Cell><Data ss:Type="Number">1</Data></Cell>
    <Cell><Data ss:
Type="String">Monday</Data></Cell>
    <Cell><Data ss:
Type="Number">120933</Data></Cell>
  </Row>

This XML code fragment represents the highlighted row in the following worksheet.

Introducing XML
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.189.23