Section 7.8.  XMLSS The Excel XML vocabulary

Prev don't be afraid of buying books Next

7.8. XMLSS: The Excel XML vocabulary

Like Word, Excel has an XML vocabulary that can be used to save entire Excel workbooks as XML documents. It is known as XML Spreadsheet (XMLSS). You can save any workbook as XMLSS, and you can open any XMLSS document as a workbook.

An XMLSS document contains the contents of each cell, as well as formatting and datatype information. Like WordML, XMLSS is very verbose. Example 7-5 shows the XMLSS representation of two rows of our expense report.

Example 7-5. XMLSS document fragment (expenses XMLSS.xml)
 <Row ss:AutoFitHeight="0" ss:Height="22.125">   <Cell ss:Style>     <Data ss:Type="DateTime">2004-04-16T00:00:00.000</Data>   </Cell>   <Cell ss:Style>     <Data ss:Type="String">Phone call from hotel</Data>   </Cell>   <Cell ss:Style/><Cell ss:Style/>   <Cell ss:Style/><Cell ss:Style/>   <Cell ss:Style/><Cell ss:Style/>   <Cell ss:Style>     <Data ss:Type="Number">0.75</Data>   </Cell>   <Cell ss:Style/><Cell ss:Style/>   <Cell ss:Style/> </Row> <Row ss:AutoFitHeight="0" ss:Height="21.5625">   <Cell ss:Style>     <Data ss:Type="DateTime">2004-04-16T00:00:00.000</Data>   </Cell>   <Cell ss:Style>     <Data ss:Type="String">Lodging</Data>   </Cell>   <Cell ss:Style/><Cell ss:Style/>   <Cell ss:Style/>   <Cell ss:Style>     <Data ss:Type="Number">158.69</Data>   </Cell>   <Cell ss:Style/><Cell ss:Style/>   <Cell ss:Style/><Cell ss:Style/>   <Cell ss:Style/><Cell ss:Style/> </Row> 

Caution

Unlike a WordML document, an XMLSS document does not contain everything there is to know about an Excel worksheet. Saving a document as XMLSS and then reopening that document in Excel may result in some missing information, in particular the macros and charts associated with that worksheet.




To save a worksheet as XMLSS:

1. On the File menu, click Save As.

2. Select XML Spreadsheet (*.xml) in the Save as type list.

3. Type the name of the file and click Save.

If you save a mapped document as XMLSS, it does not intertwine the custom tags (for example, <empName>) with the XMLSS tags, the way Word does with WordML. However, it does save a copy of the schema, as well as the XPath expressions that map between the cells and the element types.

XMLSS is potentially useful for software that converts Excel worksheets to and from other spreadsheet representations. However, it is of limited utility for general applications because:

  • It does not contain any information about the meaning of the data.

  • It is rather verbose and difficult to understand.

  • It is difficult to write a stylesheet to extract information from XMLSS because most data items are not in fixed cells; their position varies from one worksheet to the next, depending on the amount of data.

Amazon


XML in Office 2003. Information Sharing with Desktop XML
XML in Office 2003: Information Sharing with Desktop XML
ISBN: 013142193X
EAN: 2147483647
Year: 2003
Pages: 176

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net