The XML Reader (PHPExcel_Reader_Excel2003XML
) that is included with PHPExcel isn't for any arbitrary XML file: that would require an incredible degree of machine intelligence to parse a file of arbitrary structure to a the determinate structure of a spreadsheet. A generic XML Reader that can take any structure of XML file and import it into an Excel document without comprehension of the structure of the XML simply isn't possible without writing your own code.
MS Excel 2003
supported a format called SpreadsheetML
, which was a zip-compressed XML file with a defined structure and - while the format is very rarely used - the PHPExcel_Reader_Excel2003XML provides support for spreadsheet files written using that format. The XMLReader.php
file in the /Examples
folder demonstrates reading a SpreadsheetML file.
Details of SpreadsheetML can be found here
EDIT
Note also that all PHPExcel Readers expect a filename as their argument, none will accept raw data in any format, or any PHP Objects
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…