- fixed bug if attribute value is entity

This commit is contained in:
Uwe Steinmann 2000-02-17 20:30:00 +00:00
parent 9eef999b38
commit d526de3fa8
2 changed files with 5 additions and 3 deletions

View File

@ -530,7 +530,8 @@ PHP_FUNCTION(domxml_attributes)
}
while(attr) {
add_assoc_string(return_value, (char *) attr->name, attr->val->content, 1);
if(attr->val->content)
add_assoc_string(return_value, (char *) attr->name, attr->val->content, 1);
attr = attr->next;
}
}
@ -907,7 +908,8 @@ static int node_attributes(zval **attributes, xmlNode *nodep)
object_init_ex(pattr, domxmlattr_class_entry_ptr);
add_property_resource(pattr, "attribute", ret);
add_property_stringl(pattr, "name", (char *) attr->name, strlen(attr->name), 1);
add_property_stringl(pattr, "value", (char *) attr->val->content, strlen(attr->val->content), 1);
if(attr->val->content)
add_property_stringl(pattr, "value", (char *) attr->val->content, strlen(attr->val->content), 1);
zend_hash_next_index_insert((*attributes)->value.ht, &pattr, sizeof(zval *), NULL);
attr = attr->next;
}

View File

@ -38,7 +38,7 @@ $xmlstr = "<?xml version='1.0'?>
<!DOCTYPE chapter SYSTEM '/share/sgml/Norman_Walsh/db3xml10/db3xml10.dtd'>
<chapter language='en'><title language='en'>Title</title>
<para language='ge'>
<informaltable language='sp'>
<informaltable language='&sp;'>
<tgroup cols='3'>
<tbody>
<row><entry>a1</entry><entry morerows='1'>b1</entry><entry>c1</entry></row>