Overview

Packages

  • JAMA
  • None
  • PHP
  • PHPExcel
    • CachedObjectStorage
    • Calculation
    • Cell
    • Chart
      • Renderer
    • Reader
      • Excel2007
      • Excel5
    • RichText
    • Settings
    • Shared
      • Escher
      • OLE
      • Trend
      • ZipArchive
    • Style
    • Worksheet
      • Drawing
    • Writer
      • 2007
      • CSV
      • Excel2007
      • Excel5
      • HTML
      • PDF

Classes

  • CholeskyDecomposition
  • Dao
  • DateTime
  • DateTimeZone
  • DOMNode
  • EigenvalueDecomposition
  • Elemento
  • Historial
  • Irradiacion
  • Latitud
  • MotorPhp
  • Panel
  • PclZip
  • Periodo
  • PHPExcel
  • PHPExcel_Autoloader
  • PHPExcel_Best_Fit
  • PHPExcel_CachedObjectStorage_APC
  • PHPExcel_CachedObjectStorage_CacheBase
  • PHPExcel_CachedObjectStorage_DiscISAM
  • PHPExcel_CachedObjectStorage_Igbinary
  • PHPExcel_CachedObjectStorage_Memcache
  • PHPExcel_CachedObjectStorage_Memory
  • PHPExcel_CachedObjectStorage_MemoryGZip
  • PHPExcel_CachedObjectStorage_MemorySerialized
  • PHPExcel_CachedObjectStorage_PHPTemp
  • PHPExcel_CachedObjectStorage_SQLite
  • PHPExcel_CachedObjectStorage_SQLite3
  • PHPExcel_CachedObjectStorage_Wincache
  • PHPExcel_CachedObjectStorageFactory
  • PHPExcel_CalcEngine_CyclicReferenceStack
  • PHPExcel_CalcEngine_Logger
  • PHPExcel_Calculation
  • PHPExcel_Calculation_Database
  • PHPExcel_Calculation_DateTime
  • PHPExcel_Calculation_Engineering
  • PHPExcel_Calculation_ExceptionHandler
  • PHPExcel_Calculation_Financial
  • PHPExcel_Calculation_FormulaParser
  • PHPExcel_Calculation_FormulaToken
  • PHPExcel_Calculation_Function
  • PHPExcel_Calculation_Functions
  • PHPExcel_Calculation_Logical
  • PHPExcel_Calculation_LookupRef
  • PHPExcel_Calculation_MathTrig
  • PHPExcel_Calculation_Statistical
  • PHPExcel_Calculation_TextData
  • PHPExcel_Calculation_Token_Stack
  • PHPExcel_Cell
  • PHPExcel_Cell_AdvancedValueBinder
  • PHPExcel_Cell_DataType
  • PHPExcel_Cell_DataValidation
  • PHPExcel_Cell_DefaultValueBinder
  • PHPExcel_Cell_Hyperlink
  • PHPExcel_Chart
  • PHPExcel_Chart_DataSeries
  • PHPExcel_Chart_DataSeriesValues
  • PHPExcel_Chart_Layout
  • PHPExcel_Chart_Legend
  • PHPExcel_Chart_PlotArea
  • PHPExcel_Chart_Renderer_jpgraph
  • PHPExcel_Chart_Title
  • PHPExcel_Comment
  • PHPExcel_DocumentProperties
  • PHPExcel_DocumentSecurity
  • PHPExcel_Exponential_Best_Fit
  • PHPExcel_HashTable
  • PHPExcel_IOFactory
  • PHPExcel_Linear_Best_Fit
  • PHPExcel_Logarithmic_Best_Fit
  • PHPExcel_NamedRange
  • PHPExcel_Polynomial_Best_Fit
  • PHPExcel_Power_Best_Fit
  • PHPExcel_Reader_Abstract
  • PHPExcel_Reader_CSV
  • PHPExcel_Reader_DefaultReadFilter
  • PHPExcel_Reader_Excel2003XML
  • PHPExcel_Reader_Excel2007
  • PHPExcel_Reader_Excel2007_Chart
  • PHPExcel_Reader_Excel2007_Theme
  • PHPExcel_Reader_Excel5
  • PHPExcel_Reader_Excel5_Escher
  • PHPExcel_Reader_Excel5_MD5
  • PHPExcel_Reader_Excel5_RC4
  • PHPExcel_Reader_Gnumeric
  • PHPExcel_Reader_HTML
  • PHPExcel_Reader_OOCalc
  • PHPExcel_Reader_SYLK
  • PHPExcel_ReferenceHelper
  • PHPExcel_RichText
  • PHPExcel_RichText_Run
  • PHPExcel_RichText_TextElement
  • PHPExcel_Settings
  • PHPExcel_Shared_CodePage
  • PHPExcel_Shared_Date
  • PHPExcel_Shared_Drawing
  • PHPExcel_Shared_Escher
  • PHPExcel_Shared_Escher_DgContainer
  • PHPExcel_Shared_Escher_DgContainer_SpgrContainer
  • PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
  • PHPExcel_Shared_Escher_DggContainer
  • PHPExcel_Shared_Escher_DggContainer_BstoreContainer
  • PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE
  • PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip
  • PHPExcel_Shared_Excel5
  • PHPExcel_Shared_File
  • PHPExcel_Shared_Font
  • PHPExcel_Shared_JAMA_LUDecomposition
  • PHPExcel_Shared_JAMA_Matrix
  • PHPExcel_Shared_JAMA_QRDecomposition
  • PHPExcel_Shared_OLE
  • PHPExcel_Shared_OLE_ChainedBlockStream
  • PHPExcel_Shared_OLE_PPS
  • PHPExcel_Shared_OLE_PPS_File
  • PHPExcel_Shared_OLE_PPS_Root
  • PHPExcel_Shared_OLERead
  • PHPExcel_Shared_PasswordHasher
  • PHPExcel_Shared_String
  • PHPExcel_Shared_TimeZone
  • PHPExcel_Shared_XMLWriter
  • PHPExcel_Shared_ZipArchive
  • PHPExcel_Shared_ZipStreamWrapper
  • PHPExcel_Style
  • PHPExcel_Style_Alignment
  • PHPExcel_Style_Border
  • PHPExcel_Style_Borders
  • PHPExcel_Style_Color
  • PHPExcel_Style_Conditional
  • PHPExcel_Style_Fill
  • PHPExcel_Style_Font
  • PHPExcel_Style_NumberFormat
  • PHPExcel_Style_Protection
  • PHPExcel_Style_Supervisor
  • PHPExcel_Worksheet
  • PHPExcel_Worksheet_AutoFilter
  • PHPExcel_Worksheet_AutoFilter_Column
  • PHPExcel_Worksheet_AutoFilter_Column_Rule
  • PHPExcel_Worksheet_BaseDrawing
  • PHPExcel_Worksheet_CellIterator
  • PHPExcel_Worksheet_ColumnDimension
  • PHPExcel_Worksheet_Drawing
  • PHPExcel_Worksheet_Drawing_Shadow
  • PHPExcel_Worksheet_HeaderFooter
  • PHPExcel_Worksheet_HeaderFooterDrawing
  • PHPExcel_Worksheet_MemoryDrawing
  • PHPExcel_Worksheet_PageMargins
  • PHPExcel_Worksheet_PageSetup
  • PHPExcel_Worksheet_Protection
  • PHPExcel_Worksheet_Row
  • PHPExcel_Worksheet_RowDimension
  • PHPExcel_Worksheet_RowIterator
  • PHPExcel_Worksheet_SheetView
  • PHPExcel_WorksheetIterator
  • PHPExcel_Writer_Abstract
  • PHPExcel_Writer_CSV
  • PHPExcel_Writer_Excel2007
  • PHPExcel_Writer_Excel2007_Chart
  • PHPExcel_Writer_Excel2007_Comments
  • PHPExcel_Writer_Excel2007_ContentTypes
  • PHPExcel_Writer_Excel2007_DocProps
  • PHPExcel_Writer_Excel2007_Drawing
  • PHPExcel_Writer_Excel2007_Rels
  • PHPExcel_Writer_Excel2007_RelsRibbon
  • PHPExcel_Writer_Excel2007_RelsVBA
  • PHPExcel_Writer_Excel2007_StringTable
  • PHPExcel_Writer_Excel2007_Style
  • PHPExcel_Writer_Excel2007_Theme
  • PHPExcel_Writer_Excel2007_Workbook
  • PHPExcel_Writer_Excel2007_Worksheet
  • PHPExcel_Writer_Excel2007_WriterPart
  • PHPExcel_Writer_Excel5
  • PHPExcel_Writer_Excel5_BIFFwriter
  • PHPExcel_Writer_Excel5_Escher
  • PHPExcel_Writer_Excel5_Font
  • PHPExcel_Writer_Excel5_Parser
  • PHPExcel_Writer_Excel5_Workbook
  • PHPExcel_Writer_Excel5_Worksheet
  • PHPExcel_Writer_Excel5_Xf
  • PHPExcel_Writer_HTML
  • PHPExcel_Writer_PDF
  • PHPExcel_Writer_PDF_Core
  • PHPExcel_Writer_PDF_DomPDF
  • PHPExcel_Writer_PDF_mPDF
  • PHPExcel_Writer_PDF_tcPDF
  • Provincia
  • Radiacion
  • SingularValueDecomposition
  • Sistema
  • trendClass
  • xajax
  • xajaxArgumentManager
  • xajaxCallableObject
  • xajaxCallableObjectPlugin
  • xajaxControl
  • xajaxControlContainer
  • xajaxCustomRequest
  • xajaxCustomResponse
  • xajaxEvent
  • xajaxEventPlugin
  • xajaxFunctionPlugin
  • xajaxIncludeClientScriptPlugin
  • xajaxLanguageManager
  • xajaxPlugin
  • xajaxPluginManager
  • xajaxRequest
  • xajaxRequestPlugin
  • xajaxResponse
  • xajaxResponseManager
  • xajaxResponsePlugin
  • xajaxScriptPlugin
  • xajaxUserFunction
  • XMLWriter

Interfaces

  • DateTimeInterface
  • Iterator
  • PHPExcel_CachedObjectStorage_ICache
  • PHPExcel_Cell_IValueBinder
  • PHPExcel_IComparable
  • PHPExcel_Reader_IReader
  • PHPExcel_Reader_IReadFilter
  • PHPExcel_RichText_ITextElement
  • PHPExcel_Writer_IWriter
  • Throwable
  • Traversable

Exceptions

  • Exception
  • PHPExcel_Calculation_Exception
  • PHPExcel_Chart_Exception
  • PHPExcel_Exception
  • PHPExcel_Reader_Exception
  • PHPExcel_Writer_Exception

Functions

  • acosh
  • agregar_elemento
  • asinh
  • atanh
  • borrar_elementos
  • borrar_gdm_ab
  • borrar_irradiacion
  • borrar_latitud
  • borrar_panel
  • borrar_periodo
  • borrar_pmp_min_pmp_max
  • borrar_radiacion
  • borrar_resumen
  • borrar_sistema
  • borrar_sombra
  • gdm_ab
  • grabar_resumen
  • historial
  • hypo
  • irradiacion
  • JAMAError
  • latitud
  • limpiar_historial
  • login
  • mb_str_replace
  • mostrar_energia_total_ch
  • mostrar_panel_md_th
  • mostrar_panel_th
  • mostrar_radiacion_md_th
  • mostrar_radiacion_th
  • mostrar_resumen_th
  • panel
  • PclZipUtilCopyBlock
  • PclZipUtilOptionText
  • PclZipUtilPathInclusion
  • PclZipUtilPathReduction
  • PclZipUtilRename
  • PclZipUtilTranslateWinPath
  • periodo
  • pmp_min_pmp_max
  • preparar_panel
  • preparar_radiacion
  • preparar_radiacion_media
  • radiacion
  • resumen
  • sistema
  • sombra
  • xajaxCompressFile
  • xajaxErrorHandler
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  • Download
  1: <?php
  2: /**
  3:  * PHPExcel
  4:  *
  5:  * Copyright (c) 2006 - 2014 PHPExcel
  6:  *
  7:  * This library is free software; you can redistribute it and/or
  8:  * modify it under the terms of the GNU Lesser General Public
  9:  * License as published by the Free Software Foundation; either
 10:  * version 2.1 of the License, or (at your option) any later version.
 11:  *
 12:  * This library is distributed in the hope that it will be useful,
 13:  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 14:  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 15:  * Lesser General Public License for more details.
 16:  *
 17:  * You should have received a copy of the GNU Lesser General Public
 18:  * License along with this library; if not, write to the Free Software
 19:  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 20:  *
 21:  * @category   PHPExcel
 22:  * @package    PHPExcel_Reader
 23:  * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
 24:  * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
 25:  * @version    1.8.0, 2014-03-02
 26:  */
 27: 
 28: 
 29: /** PHPExcel root directory */
 30: if (!defined('PHPEXCEL_ROOT')) {
 31:     /**
 32:      * @ignore
 33:      */
 34:     define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
 35:     require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
 36: }
 37: 
 38: /**
 39:  * PHPExcel_Reader_HTML
 40:  *
 41:  * @category   PHPExcel
 42:  * @package    PHPExcel_Reader
 43:  * @copyright  Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
 44:  */
 45: class PHPExcel_Reader_HTML extends PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader
 46: {
 47:     /**
 48:      * Input encoding
 49:      *
 50:      * @var string
 51:      */
 52:     private $_inputEncoding = 'ANSI';
 53: 
 54:     /**
 55:      * Sheet index to read
 56:      *
 57:      * @var int
 58:      */
 59:     private $_sheetIndex    = 0;
 60: 
 61:     /**
 62:      * Formats
 63:      *
 64:      * @var array
 65:      */
 66:     private $_formats = array( 'h1' => array( 'font' => array( 'bold' => true,
 67:                                                                'size' => 24,
 68:                                                              ),
 69:                                             ),  //  Bold, 24pt
 70:                                'h2' => array( 'font' => array( 'bold' => true,
 71:                                                                'size' => 18,
 72:                                                              ),
 73:                                             ),  //  Bold, 18pt
 74:                                'h3' => array( 'font' => array( 'bold' => true,
 75:                                                                'size' => 13.5,
 76:                                                              ),
 77:                                             ),  //  Bold, 13.5pt
 78:                                'h4' => array( 'font' => array( 'bold' => true,
 79:                                                                'size' => 12,
 80:                                                              ),
 81:                                             ),  //  Bold, 12pt
 82:                                'h5' => array( 'font' => array( 'bold' => true,
 83:                                                                'size' => 10,
 84:                                                              ),
 85:                                             ),  //  Bold, 10pt
 86:                                'h6' => array( 'font' => array( 'bold' => true,
 87:                                                                'size' => 7.5,
 88:                                                              ),
 89:                                             ),  //  Bold, 7.5pt
 90:                                'a'  => array( 'font' => array( 'underline' => true,
 91:                                                                'color' => array( 'argb' => PHPExcel_Style_Color::COLOR_BLUE,
 92:                                                                                ),
 93:                                                              ),
 94:                                             ),  //  Blue underlined
 95:                                'hr' => array( 'borders' => array( 'bottom' => array( 'style' => PHPExcel_Style_Border::BORDER_THIN,
 96:                                                                                      'color' => array( PHPExcel_Style_Color::COLOR_BLACK,
 97:                                                                                                      ),
 98:                                                                                    ),
 99:                                                                 ),
100:                                             ),  //  Bottom border
101:                              );
102: 
103: 
104:     /**
105:      * Create a new PHPExcel_Reader_HTML
106:      */
107:     public function __construct() {
108:         $this->_readFilter  = new PHPExcel_Reader_DefaultReadFilter();
109:     }
110: 
111:     /**
112:      * Validate that the current file is an HTML file
113:      *
114:      * @return boolean
115:      */
116:     protected function _isValidFormat()
117:     {
118:         //  Reading 2048 bytes should be enough to validate that the format is HTML
119:         $data = fread($this->_fileHandle, 2048);
120:         if ((strpos($data, '<') !== FALSE) &&
121:             (strlen($data) !== strlen(strip_tags($data)))) {
122:             return TRUE;
123:         }
124: 
125:         return FALSE;
126:     }
127: 
128:     /**
129:      * Loads PHPExcel from file
130:      *
131:      * @param   string      $pFilename
132:      * @return  PHPExcel
133:      * @throws  PHPExcel_Reader_Exception
134:      */
135:     public function load($pFilename)
136:     {
137:         // Create new PHPExcel
138:         $objPHPExcel = new PHPExcel();
139: 
140:         // Load into this instance
141:         return $this->loadIntoExisting($pFilename, $objPHPExcel);
142:     }
143: 
144:     /**
145:      * Set input encoding
146:      *
147:      * @param string $pValue Input encoding
148:      */
149:     public function setInputEncoding($pValue = 'ANSI')
150:     {
151:         $this->_inputEncoding = $pValue;
152:         return $this;
153:     }
154: 
155:     /**
156:      * Get input encoding
157:      *
158:      * @return string
159:      */
160:     public function getInputEncoding()
161:     {
162:         return $this->_inputEncoding;
163:     }
164: 
165:     //  Data Array used for testing only, should write to PHPExcel object on completion of tests
166:     private $_dataArray = array();
167: 
168:     private $_tableLevel = 0;
169:     private $_nestedColumn = array('A');
170: 
171:     private function _setTableStartColumn($column) {
172:         if ($this->_tableLevel == 0)
173:             $column = 'A';
174:         ++$this->_tableLevel;
175:         $this->_nestedColumn[$this->_tableLevel] = $column;
176: 
177:         return $this->_nestedColumn[$this->_tableLevel];
178:     }
179: 
180:     private function _getTableStartColumn() {
181:         return $this->_nestedColumn[$this->_tableLevel];
182:     }
183: 
184:     private function _releaseTableStartColumn() {
185:         --$this->_tableLevel;
186:         return array_pop($this->_nestedColumn);
187:     }
188: 
189:     private function _flushCell($sheet,$column,$row,&$cellContent) {
190:         if (is_string($cellContent)) {
191:             //  Simple String content
192:             if (trim($cellContent) > '') {
193:                 //  Only actually write it if there's content in the string
194: //              echo 'FLUSH CELL: ' , $column , $row , ' => ' , $cellContent , '<br />';
195:                 //  Write to worksheet to be done here...
196:                 //  ... we return the cell so we can mess about with styles more easily
197:                 $cell = $sheet->setCellValue($column.$row,$cellContent,true);
198:                 $this->_dataArray[$row][$column] = $cellContent;
199:             }
200:         } else {
201:             //  We have a Rich Text run
202:             //  TODO
203:             $this->_dataArray[$row][$column] = 'RICH TEXT: ' . $cellContent;
204:         }
205:         $cellContent = (string) '';
206:     }
207: 
208:     private function _processDomElement(DOMNode $element, $sheet, &$row, &$column, &$cellContent){
209:         foreach($element->childNodes as $child){
210:             if ($child instanceof DOMText) {
211:                 $domText = preg_replace('/\s+/',' ',trim($child->nodeValue));
212:                 if (is_string($cellContent)) {
213:                     //  simply append the text if the cell content is a plain text string
214:                     $cellContent .= $domText;
215:                 } else {
216:                     //  but if we have a rich text run instead, we need to append it correctly
217:                     //  TODO
218:                 }
219:             } elseif($child instanceof DOMElement) {
220: //              echo '<b>DOM ELEMENT: </b>' , strtoupper($child->nodeName) , '<br />';
221: 
222:                 $attributeArray = array();
223:                 foreach($child->attributes as $attribute) {
224: //                  echo '<b>ATTRIBUTE: </b>' , $attribute->name , ' => ' , $attribute->value , '<br />';
225:                     $attributeArray[$attribute->name] = $attribute->value;
226:                 }
227: 
228:                 switch($child->nodeName) {
229:                     case 'meta' :
230:                         foreach($attributeArray as $attributeName => $attributeValue) {
231:                             switch($attributeName) {
232:                                 case 'content':
233:                                     //  TODO
234:                                     //  Extract character set, so we can convert to UTF-8 if required
235:                                     break;
236:                             }
237:                         }
238:                         $this->_processDomElement($child,$sheet,$row,$column,$cellContent);
239:                         break;
240:                     case 'title' :
241:                         $this->_processDomElement($child,$sheet,$row,$column,$cellContent);
242:                         $sheet->setTitle($cellContent);
243:                         $cellContent = '';
244:                         break;
245:                     case 'span'  :
246:                     case 'div'   :
247:                     case 'font'  :
248:                     case 'i'     :
249:                     case 'em'    :
250:                     case 'strong':
251:                     case 'b'     :
252: //                      echo 'STYLING, SPAN OR DIV<br />';
253:                         if ($cellContent > '')
254:                             $cellContent .= ' ';
255:                         $this->_processDomElement($child,$sheet,$row,$column,$cellContent);
256:                         if ($cellContent > '')
257:                             $cellContent .= ' ';
258: //                      echo 'END OF STYLING, SPAN OR DIV<br />';
259:                         break;
260:                     case 'hr' :
261:                         $this->_flushCell($sheet,$column,$row,$cellContent);
262:                         ++$row;
263:                         if (isset($this->_formats[$child->nodeName])) {
264:                             $sheet->getStyle($column.$row)->applyFromArray($this->_formats[$child->nodeName]);
265:                         } else {
266:                             $cellContent = '----------';
267:                             $this->_flushCell($sheet,$column,$row,$cellContent);
268:                         }
269:                         ++$row;
270:                     case 'br' :
271:                         if ($this->_tableLevel > 0) {
272:                             //  If we're inside a table, replace with a \n
273:                             $cellContent .= "\n";
274:                         } else {
275:                             //  Otherwise flush our existing content and move the row cursor on
276:                             $this->_flushCell($sheet,$column,$row,$cellContent);
277:                             ++$row;
278:                         }
279: //                      echo 'HARD LINE BREAK: ' , '<br />';
280:                         break;
281:                     case 'a'  :
282: //                      echo 'START OF HYPERLINK: ' , '<br />';
283:                         foreach($attributeArray as $attributeName => $attributeValue) {
284:                             switch($attributeName) {
285:                                 case 'href':
286: //                                  echo 'Link to ' , $attributeValue , '<br />';
287:                                     $sheet->getCell($column.$row)->getHyperlink()->setUrl($attributeValue);
288:                                     if (isset($this->_formats[$child->nodeName])) {
289:                                         $sheet->getStyle($column.$row)->applyFromArray($this->_formats[$child->nodeName]);
290:                                     }
291:                                     break;
292:                             }
293:                         }
294:                         $cellContent .= ' ';
295:                         $this->_processDomElement($child,$sheet,$row,$column,$cellContent);
296: //                      echo 'END OF HYPERLINK:' , '<br />';
297:                         break;
298:                     case 'h1' :
299:                     case 'h2' :
300:                     case 'h3' :
301:                     case 'h4' :
302:                     case 'h5' :
303:                     case 'h6' :
304:                     case 'ol' :
305:                     case 'ul' :
306:                     case 'p'  :
307:                         if ($this->_tableLevel > 0) {
308:                             //  If we're inside a table, replace with a \n
309:                             $cellContent .= "\n";
310: //                          echo 'LIST ENTRY: ' , '<br />';
311:                             $this->_processDomElement($child,$sheet,$row,$column,$cellContent);
312: //                          echo 'END OF LIST ENTRY:' , '<br />';
313:                         } else {
314:                             if ($cellContent > '') {
315:                                 $this->_flushCell($sheet,$column,$row,$cellContent);
316:                                 $row += 2;
317:                             }
318: //                          echo 'START OF PARAGRAPH: ' , '<br />';
319:                             $this->_processDomElement($child,$sheet,$row,$column,$cellContent);
320: //                          echo 'END OF PARAGRAPH:' , '<br />';
321:                             $this->_flushCell($sheet,$column,$row,$cellContent);
322: 
323:                             if (isset($this->_formats[$child->nodeName])) {
324:                                 $sheet->getStyle($column.$row)->applyFromArray($this->_formats[$child->nodeName]);
325:                             }
326: 
327:                             $row += 2;
328:                             $column = 'A';
329:                         }
330:                         break;
331:                     case 'li'  :
332:                         if ($this->_tableLevel > 0) {
333:                             //  If we're inside a table, replace with a \n
334:                             $cellContent .= "\n";
335: //                          echo 'LIST ENTRY: ' , '<br />';
336:                             $this->_processDomElement($child,$sheet,$row,$column,$cellContent);
337: //                          echo 'END OF LIST ENTRY:' , '<br />';
338:                         } else {
339:                             if ($cellContent > '') {
340:                                 $this->_flushCell($sheet,$column,$row,$cellContent);
341:                             }
342:                             ++$row;
343: //                          echo 'LIST ENTRY: ' , '<br />';
344:                             $this->_processDomElement($child,$sheet,$row,$column,$cellContent);
345: //                          echo 'END OF LIST ENTRY:' , '<br />';
346:                             $this->_flushCell($sheet,$column,$row,$cellContent);
347:                             $column = 'A';
348:                         }
349:                         break;
350:                     case 'table' :
351:                         $this->_flushCell($sheet,$column,$row,$cellContent);
352:                         $column = $this->_setTableStartColumn($column);
353: //                      echo 'START OF TABLE LEVEL ' , $this->_tableLevel , '<br />';
354:                         if ($this->_tableLevel > 1)
355:                             --$row;
356:                         $this->_processDomElement($child,$sheet,$row,$column,$cellContent);
357: //                      echo 'END OF TABLE LEVEL ' , $this->_tableLevel , '<br />';
358:                         $column = $this->_releaseTableStartColumn();
359:                         if ($this->_tableLevel > 1) {
360:                             ++$column;
361:                         } else {
362:                             ++$row;
363:                         }
364:                         break;
365:                     case 'thead' :
366:                     case 'tbody' :
367:                         $this->_processDomElement($child,$sheet,$row,$column,$cellContent);
368:                         break;
369:                     case 'tr' :
370:                         ++$row;
371:                         $column = $this->_getTableStartColumn();
372:                         $cellContent = '';
373: //                      echo 'START OF TABLE ' , $this->_tableLevel , ' ROW<br />';
374:                         $this->_processDomElement($child,$sheet,$row,$column,$cellContent);
375: //                      echo 'END OF TABLE ' , $this->_tableLevel , ' ROW<br />';
376:                         break;
377:                     case 'th' :
378:                     case 'td' :
379: //                      echo 'START OF TABLE ' , $this->_tableLevel , ' CELL<br />';
380:                         $this->_processDomElement($child,$sheet,$row,$column,$cellContent);
381: //                      echo 'END OF TABLE ' , $this->_tableLevel , ' CELL<br />';
382:                         $this->_flushCell($sheet,$column,$row,$cellContent);
383:                         ++$column;
384:                         break;
385:                     case 'body' :
386:                         $row = 1;
387:                         $column = 'A';
388:                         $content = '';
389:                         $this->_tableLevel = 0;
390:                         $this->_processDomElement($child,$sheet,$row,$column,$cellContent);
391:                         break;
392:                     default:
393:                         $this->_processDomElement($child,$sheet,$row,$column,$cellContent);
394:                 }
395:             }
396:         }
397:     }
398: 
399:     /**
400:      * Loads PHPExcel from file into PHPExcel instance
401:      *
402:      * @param   string      $pFilename
403:      * @param   PHPExcel    $objPHPExcel
404:      * @return  PHPExcel
405:      * @throws  PHPExcel_Reader_Exception
406:      */
407:     public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel)
408:     {
409:         // Open file to validate
410:         $this->_openFile($pFilename);
411:         if (!$this->_isValidFormat()) {
412:             fclose ($this->_fileHandle);
413:             throw new PHPExcel_Reader_Exception($pFilename . " is an Invalid HTML file.");
414:         }
415:         //  Close after validating
416:         fclose ($this->_fileHandle);
417: 
418:         // Create new PHPExcel
419:         while ($objPHPExcel->getSheetCount() <= $this->_sheetIndex) {
420:             $objPHPExcel->createSheet();
421:         }
422:         $objPHPExcel->setActiveSheetIndex( $this->_sheetIndex );
423: 
424:         //  Create a new DOM object
425:         $dom = new domDocument;
426:         //  Reload the HTML file into the DOM object
427:         $loaded = $dom->loadHTMLFile($pFilename, PHPExcel_Settings::getLibXmlLoaderOptions());
428:         if ($loaded === FALSE) {
429:             throw new PHPExcel_Reader_Exception('Failed to load ',$pFilename,' as a DOM Document');
430:         }
431: 
432:         //  Discard white space
433:         $dom->preserveWhiteSpace = false;
434: 
435: 
436:         $row = 0;
437:         $column = 'A';
438:         $content = '';
439:         $this->_processDomElement($dom,$objPHPExcel->getActiveSheet(),$row,$column,$content);
440: 
441: //      echo '<hr />';
442: //      var_dump($this->_dataArray);
443: 
444:         // Return
445:         return $objPHPExcel;
446:     }
447: 
448:     /**
449:      * Get sheet index
450:      *
451:      * @return int
452:      */
453:     public function getSheetIndex() {
454:         return $this->_sheetIndex;
455:     }
456: 
457:     /**
458:      * Set sheet index
459:      *
460:      * @param   int     $pValue     Sheet index
461:      * @return PHPExcel_Reader_HTML
462:      */
463:     public function setSheetIndex($pValue = 0) {
464:         $this->_sheetIndex = $pValue;
465:         return $this;
466:     }
467: 
468: }
469: 
Autene API documentation generated by ApiGen