Why create_element function always return false?
| From: | Victor | Date: | Sat, 05 May 2007 02:44:06 +0000 |
| Subject: | Why create_element function always return false? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-254461@lists.php.net to get a copy of this message | ||
<?php
$doc = domxml_new_doc("1.0");
$node = $doc->create_element("para");
$newnode = $doc->append_child($node);
$newnode->set_attribute("align", "left");
?>
I just run the example that is from php manual. But there is some error
------------------------------------------------------------------------------
Warning: domnode::append_child() expects parameter 1 to be object, null
given in C:\AppServ\www\tutorial\test.php on line 4
Fatal error: Call to a member function set_attribute() on a non-object
in C:\AppServ\www\tutorial\test.php on line 5
------------------------------------------------------------------------------
It is very strange....I found that create_element always return
false....nomatter what I do....what example I tried...
Not only create_element return false but also create_coment do so...
Why???
I run php 5.2.2 with AppServ . The version of docmxl is 20626 (I just
call domxml_version() ). OS is Windows XP.
Would someone help me ,please?
Thanks a lot.
Victor.