1

Is it possible to open a xml-file in a odt-container (which is a zip-container) directly via php? By now I extract the odt-container manually to get the content.xml file out of it. Would be much easier if my php-script could process the odt-file directly.

$reader = new XMLReader();
if (!$reader->open("content.xml", 'UTF-8')) die("Failed to open 'content.xml'");
while ($reader->read()){ 
    // Do further processing
}

Update: $reader->open('zip://'.$odt_file.'#content.xml')

user3142695
  • 13,907
  • 34
  • 141
  • 281

0 Answers0