]> granicus.if.org Git - php/commitdiff
- fixed several bugs an did some testing. Parsing and creating simple
authorUwe Steinmann <steinm@php.net>
Wed, 9 Feb 2000 12:46:32 +0000 (12:46 +0000)
committerUwe Steinmann <steinm@php.net>
Wed, 9 Feb 2000 12:46:32 +0000 (12:46 +0000)
  XML docs should work. See the script testdom.

NEWS
ext/domxml/domxml.c
tests/testdom

diff --git a/NEWS b/NEWS
index 0b48e146c8cee035318dc9ca76507976d557d096..1936ab09925ca32193b99d1021e065c21dd61e9e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ PHP 4.0                                                                    NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 
 ?? ?? ????, 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 c71089120c36b4afcb0b122a37d055ac037567f8..9358a08b99a8d729cb43f2f1724142c59fd1395f 100644 (file)
@@ -735,7 +735,10 @@ PHP_FUNCTION(domxml_newchild)
                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 @@ PHP_FUNCTION(domxml_newchild)
 
        /* 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 @@ PHP_FUNCTION(domxml_addroot)
        if (!node) {
                RETURN_FALSE;
        }
+       docp->root = node;
        ret = zend_list_insert(node, le_domxmlnodep);
 
        /* construct an object with some methods */
index 3b850f4ef9bbab391180b8d6c15c2362857d116d..d8d3d12d3ea42698d3817270c67c417c6e729db9 100644 (file)
@@ -63,9 +63,11 @@ output_node($rootnode);
 
 $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();
 
 ?>