Re: Return XML attribute in DOM

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

 



Doesn't the DOM have the getAttribute() method?

Thanks,
Ash
http://www.ashleysheridan.co.uk

It's not in my reference, though I see it in the PHP manual now.
This is what I have:

_____________________________

$dom = new DomDocument();
$dom -> load("items.xml");

$topics = $dom -> getElementsByTagName("item");

echo("<ul>");
foreach ($topics as $node )
{
	echo("<li>". $node -> hasAttributes() ."</li>");	
}
echo("</ul>");

______________________________

I'm replacing hasAttributes() with getAttribute() but its throwing me an error, I'm probably using it incorrectly.
I think I'm drowning in the deep end =/
Could you advise Gamesmaster ?

--
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