O'Reilly logo

XSLT Cookbook by Sal Mangano

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with Excel XML Spreadsheets

Problem

You want to export data from Excel to XML, but not in the native format supported by Microsoft.

Solution

If you have an Excel spreadsheet that looks like this:

Date

Price

Volume

20010817

61.88

260163

20010820

62.7

241859

20010821

60.78

233989

20010822

60.66

387444

Then the Excel XML version looks like this:

<?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"> <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"> <Author>Salvatore R. Mangano</Author> <LastAuthor>Salvatore R. Mangano</LastAuthor> <Created>2002-08-18T00:43:49Z</Created> <LastSaved>2002-08-18T02:19:21Z</LastSaved> <Company>Descriptix</Company> <Version>10.3501</Version> </DocumentProperties> <OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office"> <DownloadComponents/> <LocationOfComponents HRef="/"/> </OfficeDocumentSettings> <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"> <WindowHeight>9915</WindowHeight> <WindowWidth>10140</WindowWidth> <WindowTopX>240</WindowTopX> <WindowTopY>255</WindowTopY> <ProtectStructure>False</ProtectStructure> <ProtectWindows>False</ProtectWindows> </ExcelWorkbook> <Styles> <Style ss:ID="Default" ss:Name="Normal"> <Alignment ss:Vertical="Bottom"/> <Borders/> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required