On 5/5/07, Victor <victor_km@xxxxxxxxxxxxxxx> wrote:
<?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.
AFAIK, append_child and create_element are decprecated, they are only used in PHP4. You should use appendchild and createelement instead. try example 498 located here: http://www.php.net/manual/en/function.dom-domdocument-createelement.php Tijnema -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php