cvs: /php4 NEWS /php4/ext/domxml domxml.c /php4/tests testdom
| From: | Uwe Steinmann | Date: | Wed, 09 Feb 2000 12:47:02 +0000 |
| Subject: | cvs: /php4 NEWS /php4/ext/domxml domxml.c /php4/tests testdom | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-9976@lists.php.net to get a copy of this message | ||
steinm Wed Feb 9 04:47:02 2000 EDT
Modified files:
/php4 NEWS
/php4/ext/domxml domxml.c
/php4/tests testdom
Log:
- fixed several bugs an did some testing. Parsing and creating simple
XML docs should work. See the script testdom.
Index: php4/NEWS
diff -u php4/NEWS:1.120 php4/NEWS:1.121
--- php4/NEWS:1.120 Tue Feb 8 18:09:07 2000
+++ php4/NEWS Wed Feb 9 04:46:31 2000
@@ -2,6 +2,7 @@
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ?? ????, Version 4.0 Beta 4
+- Added domxml extension based on libxml, still little functionality (Uwe)
- Fixed memory corruption in fgetss(), strip_tags() and gzgetss() (Zeev)
- Updated calendar dynamic library to work with PHP4. (Evan)
- Added strncmp() function, courtesy of Walter. (Andrei)
Index: php4/ext/domxml/domxml.c
diff -u php4/ext/domxml/domxml.c:1.10 php4/ext/domxml/domxml.c:1.11
--- php4/ext/domxml/domxml.c:1.10 Thu Feb 3 13:11:58 2000
+++ php4/ext/domxml/domxml.c Wed Feb 9 04:46:31 2000
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: domxml.c,v 1.10 2000/02/03 21:11:58 steinm Exp $ */
+/* $Id: domxml.c,v 1.11 2000/02/09 12:46:31 steinm Exp $ */
#include "php.h"
@@ -735,7 +735,10 @@
RETURN_FALSE;
}
- child = xmlNewChild(nodep, NULL, name->value.str.val, content->value.str.val);
+ if(content->value.str.len)
+ child = xmlNewChild(nodep, NULL, name->value.str.val, content->value.str.val);
+ else
+ child = xmlNewChild(nodep, NULL, name->value.str.val, NULL);
if (!child) {
RETURN_FALSE;
}
@@ -743,7 +746,7 @@
/* construct an object with some methods */
object_init_ex(return_value, domxmlnode_class_entry_ptr);
- add_property_long(return_value, "child", ret);
+ add_property_long(return_value, "node", ret);
add_property_long(return_value, "type", child->type);
add_property_stringl(return_value, "name", (char *) child->name,
strlen(child->name), 1);
if(content->value.str.val)
@@ -794,6 +797,7 @@
if (!node) {
RETURN_FALSE;
}
+ docp->root = node;
ret = zend_list_insert(node, le_domxmlnodep);
/* construct an object with some methods */
Index: php4/tests/testdom
diff -u php4/tests/testdom:1.3 php4/tests/testdom:1.4
--- php4/tests/testdom:1.3 Thu Feb 3 13:12:30 2000
+++ php4/tests/testdom Wed Feb 9 04:46:32 2000
@@ -63,9 +63,11 @@
$doc = newxmldoc("1.0");
$root = $doc->addroot("HTML");
-echo $root->name;
$root->newchild("TITLE", "Hier der Titel");
-$root->newchild("BODY", "");
+$body = $root->newchild("BODY", "");
+$table = $body->newchild("TABLE", "");
+$table->setattr("WIDTH", "100%");
+$table->newchild("TR", " ");
echo $doc->dumpmem();
?>