From php-general Wed Jun 23 14:42:25 2004 From: Gabriel Birke Date: Wed, 23 Jun 2004 14:42:25 +0000 To: php-general Subject: Re: [PHP] Help with creating an XML Document Message-Id: <8B4C3587-C523-11D8-A370-003065FA313E () kontor4 ! de> X-MARC-Message: https://marc.info/?l=php-general&m=108800174821134 I think you only have to change one line of your php code: $text = $doc->create_text_node("000000"); instead of $text = $doc->create_text_node($el["000000"]); With best regards Gabriel Birke -- KONTOR4_Neue Medien Plathnerstraße 5 30175 Hannover Fax: +49 51184 48 98 99 mailto:birke@kontor4.de http://www.kontor4.de Am 23.06.2004 um 16:18 schrieb Eric L. Sammons: > Using PHP 4.3.2 I am trying to create an XML file that looks similar > to the > following: > > > > 000000000 > 00000 > DL380 > 8th Floor > 2 > Customer > Upgrade > > > > I get the following output: > > Name="pxtest01"> > > Using the following code: > > > $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); > $text = $doc->create_text_node($el["000000"]); > $el->append_child($text); > print htmlentities($doc->dump_mem()); > > ?> > > 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 > 0000000 > > Thank you! > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php