[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-general
Subject:    Re: [PHP] Help with creating an XML Document
From:       "Matt Matijevich" <matijevich () alliancetechnologies ! net>
Date:       2004-06-23 14:36:08
Message-ID: s0d94f27.095 () NW0101DSM ! ALLIANCETECHNOLOGIES ! NET
[Download RAW message or body]

[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>";

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic