#36574 [Bgs]: getElementById can`t "see" ID in html-tag <input>

From: Date: Wed, 01 Mar 2006 21:25:12 +0000
Subject: #36574 [Bgs]: getElementById can`t "see" ID in html-tag <input>
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-93816@lists.php.net to get a copy of this message
ID: 36574 Updated by: rrichards@php.net Reported By: taymir at gmail dot com Status: Bogus Bug Type: DOM XML related Operating System: Windows XP pro PHP Version: 5.1.2 New Comment: Before this gets re-opened, as its still bogus. Its a libxml2 bug being taken care of there. Previous Comments: ------------------------------------------------------------------------ [2006-03-01 22:14:16] taymir at gmail dot com Here is more accurate example: http://pastebin.com/579031 The result is: 1) form: object(DOMElement)#2 (0) { } 2) input: NULL 3) input: NULL As you can see, I`ve used validateOnParse property. getElementById()-method works fine (even without validation) with any html-tag (well, at least with those I`ve tested) except input. ------------------------------------------------------------------------ [2006-03-01 19:17:31] bjori@php.net 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() ------------------------------------------------------------------------ [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

« previous php.bugs (#93816) next »