Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geeting error while reading word doc Please help #424

Open
gmpankajarora opened this issue Nov 13, 2014 · 4 comments
Open

Geeting error while reading word doc Please help #424

gmpankajarora opened this issue Nov 13, 2014 · 4 comments

Comments

@gmpankajarora
Copy link

gmpankajarora commented Nov 13, 2014

Kindly have a look at below output while trying to read word doc file.

Sample 11 ReadWord2007
12:16:54 Reading contents from D:\xampp\htdocs\docreader\PHPWord\samples/resources/Sample_11_ReadWord2007.docx

Catchable fatal error: Argument 2 passed to DOMXPath::query() must be an instance of DOMNode, null given, called in D:\xampp\htdocs\docreader\PHPWord\src\PhpWord\Reader\Word2007.php on line 145 and defined in D:\xampp\htdocs\docreader\PHPWord\src\PhpWord\Shared\XMLReader.php on line 99

Can you please help me to resolve this.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@jorgearnez
Copy link

I have the same problem and I woud like to know if you get around with some solution.
The problem is related to the getElement($path, \DOMElement $contextNode = null) function parameters. The second parameter is missing at $nodes = $xmlReader->getElements('*'); call located in Word2007.php file.

@nafwa03
Copy link

nafwa03 commented Dec 26, 2014

That looks like a namespace or autoloader issue.

@jorgearnez
Copy link

I have found the solution to this problem. As mentioned the parameters were not well handled. (A bug)
https://scrutinizer-ci.com/g/PHPOffice/PHPWord/issues/master/files/src/PhpWord/Shared/XMLReader.php?orderField=path&order=asc
The problem has been solved in the development version of PHPword so just download it and check the differences.

@Progi1984
Copy link
Member

Okay for you @nafwa03 ?

@github-actions github-actions bot added the Stale label Nov 18, 2022
@Progi1984 Progi1984 removed the Stale label Nov 18, 2022
@PHPOffice PHPOffice deleted a comment from github-actions bot Jan 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants