Forum


Replies: 2   Views: 363
Createdocxfromtemplate error : getelementsbytagname()
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by ordersvrc  · 18-12-2023 - 01:00

Getting a [17-Dec-2023 18:53:43 America/Chicago] PHP Fatal error:  Uncaught Error: Call to a member function getElementsByTagName() on bool in ....    on line 897

Its a valid docx file.  

Tried debugging the library myself but got nowhere.

Posted by ordersvrc  · 18-12-2023 - 02:15

Update... after familiarizing myself with your code, I determined that the problem was that the structure of my .docx files was much different then what you were searching.... 


I didnt want mess with too many things so I added the below to your getFromZip method.=
 

if(!$XMLData){

                $XMLData = $this->_zipDocx->getContent(str_replace('word/','',$src));

}

Posted by admin  · 18-12-2023 - 05:58

Hello,

If you send to contact[at]phpdocx.com a DOCX sample we'll check it. phpdocx handles many not standard DOCX structures automatically (such as those without a valid main section, the main document is not document.xml, strict variants and others). Maybe you are not using DOCX format but other OOXML document format? How has the DOCX been generated?

Regards.