|
NAMESpreadsheet::WriteExcel::FromXML - Create Excel Spreadsheet from XMLSYNOPSISuse strict; use warnings; use Spreadsheet::WriteExcel::FromXML; my $fromxml = Spreadsheet::WriteExcel::FromXML->new( "file.xml" ); $fromxml->parse; $fromxml->buildSpreadsheet; $fromxml->writeFile("file.xls"); # or my $data = $fromxml->getSpreadsheetData; # then write $data to a file...or do with it as you wish # or, even simpler: my $data = Spreadsheet::WriteExcel::FromXML->BuildSpreadsheet( "file.xml" ); # or, even simpler: Spreadsheet::WriteExcel::FromXML->XMLToXLS( "file.xml", "file.xls" ); DESCRIPTIONThis module uses Spreadsheet::WriteExcel to turn a simple XML data file into a binary Excel XLS file.See also the FromXML.dtd file in the distribution. API REFERENCEnew([$])Param: XML file name - name of file to be parsed. Return: ToExcel object.Constructor. Optionally takes an XML file name. private void _initializeXMLSource($)Param: XML file source (GLOB, IO::Handle, file name or XML as a string [or scalar ref]) Return: true Throws: exception if unable toInitializer method to check for existance of the XML file. parseParam: XML file name or an IO::Handle [optional]. Return: true Throws: exception if xmlsource initialization fails, or if parsing failsA method to make the necessary calls to parse the XML file. Remember, if a file handle is passed in the calling code is responsible for closing it. _parseXMLFileToTreeParam: none. Return: trueA method to parse an XML file into a tree-style data structure using XML::Parser. _processTreeParam: $ar - child xml elements Param: $xmltag - the xml tag name (string) Param: $rownum - the current row number in the internal worksheet Param: $column - the current column number in the current row Param: $rowformat Return: void. A method for taking the tree-style data structure from XML::Parser and sticking the data into our object structure & Spreadsheet::WriteExcel. After this method is called, we have an Excel spreadsheet ready for output. writeFile($)Param: filename - file name to output Excel data to. Return: true/false Throws: exception if unable to open the file.writeFile takes a file name and writes the XLS data from the internal buffer to the specified file. getSpreadsheetDataOnce the spreadsheet has been generated, this method returns the binary representation of the spreadsheet.workbook([$])Get/set method to reference our Workbook object._treeData([$])Get/set method for the raw XML tree data._xmlfh([$])Get/set method for the XML file that is being parsed.bigflag([$])Get/set method for large (>7mb) Excel spreadsheets. If set, the code will make the appriopriate calls to build a spreadsheet >7mb. This requires a patch to OLE::Storage_Lite.SEE ALSOSpreadSheet::WriteExcel SpreadSheet::WriteExcel::FromDB OLE::Storage_LiteAUTHORSW. Justin Bedard juice [at] lerch.orgKyle R. Burton mortis [at] voicenet.com, krburton [at] cpan.org Brendan W. McAdams bwmcadams [at] cpan.org <Since 1.10>
Visit the GSP FreeBSD Man Page Interface. |