Replies: 5   Views: 436
Handle other xml namespaces
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 Aldryss  · 18-03-2020 - 09:22


Our company uses phpdocx and we encountered a problem while importing a docx file where the document.xml has the following document declaration :

<w:document xmlns:w="" xmlns:aink="" xmlns:am3d="" xmlns:cx="" xmlns:cx1="" xmlns:cx2="" xmlns:cx3="" xmlns:cx4="" xmlns:cx5="" xmlns:cx6="" xmlns:cx7="" xmlns:cx8="" xmlns:m="" xmlns:mc="" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w14="" xmlns:w15="" xmlns:w16cid="" xmlns:w16se="" xmlns:wne="" xmlns:wp="" xmlns:wp14="" xmlns:wpi="" mc:Ignorable="w14 w15 w16se w16cid wne wp14" w:conformance="strict">

the error occurs when extracting text from a docx document (using the Docx2Text class), on 

$bodyNode = $this->domDocument->getElementsByTagNameNS('', 'body');

Could you handle other valid xml namespaces, so these documents are also parsed by phpdox?

Thanks a lot