Re: Problems getting the nodeName with DomDocument

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Kenneth Andresen wrote:
I am having problems with the following functions where my return simply is "#text Joe #text Smith #text unknown", it should have read
firstname Joe lastname Smith address unknown

What am I doing wrong?

You're trying to access the name of the Text node which is always #text and not it's parent element.
$name = $elem->parentNode->nodeName;

Rob

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux