php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17629 DomDocument->get_element_by_id still broken
Submitted: 2002-06-06 14:01 UTC Modified: 2002-06-12 07:14 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: bigredlinux at yahoo dot com Assigned:
Status: Closed Package: DOM XML related
PHP Version: 4.2.1 OS: linux redhat 7.2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: bigredlinux at yahoo dot com
New email:
PHP Version: OS:

 

 [2002-06-06 14:01 UTC] bigredlinux at yahoo dot com
Reopening this bug.  I understand that the function should use the id hash as built from reading the DTD, which this function now attempts to do.  However, now the result of get_element_by_id is NULL

Here is the output running the bleeding edge version of domxml from the following code:

output: NULL

code:

<?php
$string = <<< _END
<!DOCTYPE html [ <!ATTLIST span id ID #REQUIRED> ]>
<html>
<head><title> Test </title></head>
<body>
<h1>Test</h1>
<span id="test">Foo</span>
</body>
</html>
_END;
$xml = domxml_open_mem($string);
$n = $xml->get_element_by_id("test");
var_dump($n);
?>

Clearly something is happening.  If I run $xml->ids() I get an array of one domnode, just as I would expect.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-12 02:56 UTC] schwier at bigfoot dot com
The same on my platform (SuSE 7.3, PHP 4.2.1, libxml2.4.22). Compiled from sources.
Workaround from Bug #16647 works well.
 [2002-06-12 07:14 UTC] chregu@php.net
fixed in CVS HEAD and PHP_4_2_0
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 15:01:34 2025 UTC