#26499 [Opn->Bgs]: is_blank_node() returns nothing
| From: | rrichards@php.net | Date: | Tue, 02 Dec 2003 16:13:30 +0000 |
| Subject: | #26499 [Opn->Bgs]: is_blank_node() returns nothing | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-51572@lists.php.net to get a copy of this message | ||
ID: 26499
Updated by: rrichards@php.net
Reported By: msw at seebi dot de
-Status: Open
+Status: Bogus
Bug Type: DOM XML related
Operating System: Windows XP Prof
PHP Version: 4.3.4
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
is_blank_node tests text and cdata nodes and returns false for all
types
Previous Comments:
------------------------------------------------------------------------
[2003-12-02 09:59:17] msw at seebi dot de
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.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=26499&edit=1