summaryrefslogtreecommitdiff
path: root/ext/domxml/php_domxml.c
diff options
context:
space:
mode:
authorJoseph Tate <jtate@php.net>2002-03-07 16:48:43 +0000
committerJoseph Tate <jtate@php.net>2002-03-07 16:48:43 +0000
commit58269f1769c4fc961029db6ea522e22c2ecaac09 (patch)
tree420f95b334ad36ef8713538f758e5810c9d9b98c /ext/domxml/php_domxml.c
parentb736409e52aaf5230a308dcc491ce1af804cdd0d (diff)
downloadphp-git-58269f1769c4fc961029db6ea522e22c2ecaac09.tar.gz
Added type attributes to XML_DTD_NODE and XML_ATTRIBUTE_NODE element types.
Reported in bug #15918.
Diffstat (limited to 'ext/domxml/php_domxml.c')
-rw-r--r--ext/domxml/php_domxml.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c
index 9246ab702a..b138bec173 100644
--- a/ext/domxml/php_domxml.c
+++ b/ext/domxml/php_domxml.c
@@ -1010,6 +1010,7 @@ static zval *php_domobject_new(xmlNodePtr obj, int *found TSRMLS_DC)
object_init_ex(wrapper, domxmlattr_class_entry);
rsrc_type = le_domxmlattrp;
add_property_stringl(wrapper, "name", (char *) attrp->name, strlen(attrp->name), 1);
+ add_property_long(wrapper, "type", Z_TYPE_P(attrp));
content = xmlNodeGetContent((xmlNodePtr) attrp);
if (content)
add_property_stringl(wrapper, "value", (char *) content, strlen(content), 1);
@@ -1049,6 +1050,7 @@ static zval *php_domobject_new(xmlNodePtr obj, int *found TSRMLS_DC)
xmlDtdPtr dtd = (xmlDtdPtr) obj;
object_init_ex(wrapper, domxmldtd_class_entry);
rsrc_type = le_domxmldtdp;
+ add_property_long(wrapper, "type", Z_TYPE_P(dtd));
if (dtd->ExternalID)
add_property_string(wrapper, "publicId", (char *) dtd->ExternalID, 1);
if (dtd->SystemID)
@@ -1064,10 +1066,9 @@ static zval *php_domobject_new(xmlNodePtr obj, int *found TSRMLS_DC)
object_init_ex(wrapper, domxmlcdata_class_entry);
rsrc_type = le_domxmlcdatap;
content = xmlNodeGetContent(nodep);
- if (content) {
- add_property_long(wrapper, "type", Z_TYPE_P(nodep));
+ add_property_long(wrapper, "type", Z_TYPE_P(nodep));
+ if (content)
add_property_stringl(wrapper, "content", (char *) content, strlen(content), 1);
- }
break;
}