php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26499 is_blank_node() returns nothing
Submitted: 2003-12-02 09:59 UTC Modified: 2003-12-02 11:13 UTC
From: msw at seebi dot de Assigned:
Status: Not a bug Package: DOM XML related
PHP Version: 4.3.4 OS: Windows XP Prof
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: msw at seebi dot de
New email:
PHP Version: OS:

 

 [2003-12-02 09:59 UTC] 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. 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-12-02 11:13 UTC] rrichards@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

is_blank_node tests text and cdata nodes and returns false for all types
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 17:01:33 2025 UTC