Re: Help with creating an XML Document

From: Date: Wed, 23 Jun 2004 14:36:08 +0000
Subject: Re: Help with creating an XML Document
Groups: php.general 
Request: Send a blank email to php-general+get-188874@lists.php.net to get a copy of this message
[snip] Can someone help me fix my code so that when I add an element I can also set some contents or a value for that element? example <serial_number>0000000</serial_number> [/snip] $doc = domxml_new_doc("1.0"); $root = $doc->add_root("Server"); $root->set_attribute("Name", "pxtest01"); $el = $doc->create_element("Serial_Number"); $root->append_child($el); $el->append_child($doc->create_text_node('000000')); echo "<pre>"; $xmlfile = $doc->dump_mem(); echo htmlentities($xmlfile); echo "</pre>";

« previous php.general (#188874) next »