#36574 [Opn->Bgs]: getElementById can`t "see" ID in html-tag <input>
| From: | bjori@php.net | Date: | Wed, 01 Mar 2006 18:17:32 +0000 |
| Subject: | #36574 [Opn->Bgs]: getElementById can`t "see" ID in html-tag <input> | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-93809@lists.php.net to get a copy of this message | ||
ID: 36574
Updated by: bjori@php.net
Reported By: taymir at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: DOM XML related
Operating System: Windows XP pro
PHP Version: 5.1.2
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
DOMDocument->validateOnParse = true;
DOMDocument->load....
-- OR --
DOMDocument->validate()
DOMDocument->getElementById()
Previous Comments:
------------------------------------------------------------------------
[2006-03-01 16:07:49] taymir at gmail dot com
Description:
------------
I use DOMDocument::loadHTML(...) method to create DOM-tree from
html-document. I want to modify some attributes of such tags as form,
select, option, input. The code works as it should for all tags except
<input ...>. I can't get input-element by ID.
Reproduce code:
---------------
<?php
$text = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN"><input id="test">';
$xml = new DOMDocument(1.0);
$xml->loadHTML($text);
var_dump($xml->getElementByID('test'));
?>
Expected result:
----------------
object(DOMElement)#2 (0) { }
Actual result:
--------------
NULL
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36574&edit=1