php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #42141 DOM getNamedItem() case-issue
Submitted: 2007-07-29 16:08 UTC Modified: 2007-07-29 21:10 UTC
From: linus dot martensson at elplan-gm dot se Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: 5.2.3 OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: linus dot martensson at elplan-gm dot se
New email:
PHP Version: OS:

 

 [2007-07-29 16:08 UTC] linus dot martensson at elplan-gm dot se
Description:
------------
DOMNamedNodeMap->getNamedItem() is case-sensitive, the ability to change this would be useful in templating systems. Add a second parameter for case-sensitive?

Reproduce code:
---------------
$xml = new DOMDocument();
$xml->loadXML('<html><head><!--yadayada--></head><body><div Id="testid"></div></body></html>');
$element = $xml->getElementById('testid');
echo $element->attributes->getNamedItem('id');

Expected result:
----------------
should echo "testid", the name of the element retrieved.

Actual result:
--------------
Echoes nothing, as the 'Id' in the xml is spelt with a capital I.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-07-29 16:15 UTC] derick@php.net
XML is case-sensitive... you'll just have to deal with this in your scripts.
 [2007-07-29 21:10 UTC] linus dot martensson at elplan-gm dot se
I see... Oh well, a suggestion is a suggestion, I just thought it'd match up better with all the other PHP functions that support both modes. 
Thanks anyways. =]
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 10:01:29 2024 UTC