|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-12-02 11:13 UTC] rrichards@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 14:00:01 2025 UTC |
Description: ------------ I've checked out DOM method is_blank_node(), which checks whether a node is empty or not. The methode is_blank_node seems to me not working correctly and returns nothing. Reproduce code: --------------- XML-Code with empty nodes: <?xml version="1.0"?> <userliste> <user> <name/> <passwort/> <datum/> <zeit/> </user> </userliste> PHP-Code to read and to use is_blank_node: <?php if(!$dom = domxml_open_file("e:/htdocs/user.xml")) { echo "Error while parsing the document\n"; exit; } $root=$dom->document_element(); print($root->is_blank_node()); $node=$dom->get_elements_by_tagname("name"); print ($node[0]->node_name()); print ($node[0]->is_blank_node()); if ($node[0]->is_blank_node()) { print("empty"); } ?> Expected result: ---------------- The PHP-code checks whether <name> is empty or not. I'v expected that is_blank_node returns true. Actual result: -------------- is_blank_node returns nothing.