Fix dumping, when dumping a text element, for example:

<?php
$doc = simplexml_load_string('<?xml version="1.0"?>
<namelist>
 <name>
  <first>helly</first>
 </name>
 <name>
  <first>sterling</first>
 </name>
</namelist>');
var_dump($doc->name[0]->first);

Used to not display the node's content, now it does.
This commit is contained in:
Sterling Hughes 2004-01-08 22:40:08 +00:00
parent 510dd7cca5
commit 406c2156d1

View File

@ -592,8 +592,17 @@ sxe_properties_get(zval *object TSRMLS_DC)
node = node->children;
while (node) {
SKIP_TEXT(node);
if (node->children != NULL || node->prev != NULL || node->next != NULL) {
SKIP_TEXT(node);
} else {
if (node->type == XML_TEXT_NODE) {
MAKE_STD_ZVAL(value);
ZVAL_STRING(value, xmlNodeListGetString(node->doc, node, 1), 1);
zend_hash_next_index_insert(rv, &value, sizeof(zval *), NULL);
goto next_iter;
}
}
name = (char *) node->name;
if (!name) {
goto next_iter;