218 foreach ($element->childNodes as $child) {
219 if ($child instanceof DOMText) {
220 $domText = preg_replace(
'/\s+/u',
' ', trim($child->nodeValue));
221 if (is_string($cellContent)) {
223 $cellContent .= $domText;
228 } elseif ($child instanceof DOMElement) {
231 $attributeArray =
array();
232 foreach ($child->attributes as $attribute) {
234 $attributeArray[$attribute->name] = $attribute->value;
237 switch ($child->nodeName) {
239 foreach ($attributeArray as $attributeName => $attributeValue) {
240 switch ($attributeName) {
251 $sheet->setTitle($cellContent);
262 if ($cellContent >
'')
265 if ($cellContent >
'')
272 if (isset($this->_formats[$child->nodeName])) {
273 $sheet->getStyle(
$column .
$row)->applyFromArray($this->_formats[$child->nodeName]);
275 $cellContent =
'----------';
280 if ($this->_tableLevel > 0) {
282 $cellContent .=
"\n";
292 foreach ($attributeArray as $attributeName => $attributeValue) {
293 switch ($attributeName) {
296 $sheet->getCell(
$column . $row)->getHyperlink()->setUrl($attributeValue);
297 if (isset($this->_formats[$child->nodeName])) {
298 $sheet->getStyle(
$column . $row)->applyFromArray($this->_formats[$child->nodeName]);
316 if ($this->_tableLevel > 0) {
318 $cellContent .=
"\n";
323 if ($cellContent >
'') {
332 if (isset($this->_formats[$child->nodeName])) {
333 $sheet->getStyle(
$column . $row)->applyFromArray($this->_formats[$child->nodeName]);
341 if ($this->_tableLevel > 0) {
343 $cellContent .=
"\n";
348 if ($cellContent >
'') {
363 if ($this->_tableLevel > 1)
368 if ($this->_tableLevel > 1) {
392 while (isset($this->rowspan[
$column . $row])) {
406 if (isset($attributeArray[
'rowspan']) && isset($attributeArray[
'colspan'])) {
409 for ($i = 0; $i < $attributeArray[
'colspan'] - 1; $i++) {
412 $range =
$column . $row .
':' . $columnTo . ($row + $attributeArray[
'rowspan'] - 1);
414 $this->rowspan[$value] =
true;
416 $sheet->mergeCells($range);
418 } elseif (isset($attributeArray[
'rowspan'])) {
420 $range =
$column . $row .
':' .
$column . ($row + $attributeArray[
'rowspan'] - 1);
422 $this->rowspan[$value] =
true;
424 $sheet->mergeCells($range);
425 } elseif (isset($attributeArray[
'colspan'])) {
428 for ($i = 0; $i < $attributeArray[
'colspan'] - 1; $i++) {
431 $sheet->mergeCells(
$column . $row .
':' . $columnTo . $row);
440 $this->_tableLevel = 0;
_releaseTableStartColumn()
_flushCell($sheet, $column, $row, &$cellContent)
Create styles array
The data for the language used.
static extractAllCellReferencesInRange($pRange='A1')
Extract all cell references in range.
_processDomElement(DOMNode $element, $sheet, &$row, &$column, &$cellContent, $format=null)
_setTableStartColumn($column)