Back to index

php5  5.3.10
odt.php
Go to the documentation of this file.
00001 <?php
00002 /* $Id: odt.php 260091 2008-05-21 09:27:41Z pajoye $ */
00003 $reader = new XMLReader();
00004 
00005 $reader->open('zip://' . dirname(__FILE__) . '/test.odt#meta.xml');
00006 $odt_meta = array();
00007 while ($reader->read()) {
00008        if ($reader->nodeType == XMLREADER::ELEMENT) {
00009               $elm = $reader->name;
00010        } else {
00011               if ($reader->nodeType == XMLREADER::END_ELEMENT && $reader->name == 'office:meta') {
00012                      break;
00013               }
00014               if (!trim($reader->value)) {
00015                      continue;
00016               }
00017               $odt_meta[$elm] = $reader->value;
00018        }
00019 }
00020 print_r($odt_meta);