简体   繁体   中英

Problem Reading XML DOM Element using PHP

I am failing! Here is my problem. I get a DOMElement Code:

$ref_cell = $new_row->childNodes->item($j);

I access the properties of said element Code: e cho $ref_cell->nodeValue; Computer says... Quote:

Trying to get property of non-object...

I try Code:

echo $ref_cell;

Computer says... Quote:

Object of class DOMElement could not be converted to string...

Can anybody explain this?

Any insight at all would be helpful - I'm about to rip my face off and put my the keyboard thru the monitor...

It's possible that the row is empty and has no child nodes. I would start by checking to make sure each level of the Dom in question contains valid content.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM