|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-01-06 12:51 UTC] rrichards@php.net
[2004-01-07 03:08 UTC] msw at seebi dot de
[2004-01-07 06:31 UTC] rrichards@php.net
[2004-01-07 11:36 UTC] msw at seebi dot de
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 21:00:01 2025 UTC |
Description: ------------ I'v used getElementById() to touch an element. It seems to me that getElementById() doesn't return anything. Reproduce code: --------------- <?php $dom = new domdocument; $t=$dom->load(dirname(__FILE__)."/news.xml"); if(!$dom) { echo "Error while parsing the document\n"; exit; } $node=$dom->getElementById("486"); print ($node); print("<br>".$node->nodeName); ?> XML: <?xml version="1.0" encoding="iso-8859-1"?> <newsliste> <news id="486" rubrik='xsl-fo' site="javaxml"> <datum>14.08.2003</datum> <headline>Kleines Update von XEP</headline> <text>blablablabla</text> <Links> <Web-Adresse xml:link='simple' href='http://xep.xattic.com/'> <text>XEP 3.5.4</text> </Web-Adresse> </Links> </news> </newsliste> Expected result: ---------------- The PHP code should print out the node name (news) Actual result: -------------- nothing