Re: php5

From: Date: Thu, 04 Mar 2004 00:28:00 +0000
Subject: Re: php5
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-179395@lists.php.net to get a copy of this message
hi again, i forgot adding the attributes, sorry :) here it is... >> I need manipulate the nodes (add and remove) . >> example >> I need add more one node >> <interface name="dmz" type="ethernet" device="eth3" >> ip="xxxxxxx" >> subnet="24"/> > > <?php > // create a new node > $newInterfaceNode = $doc->createElement("interface"); > // append this node under network > $newInterfaceNode = $networkNode->appendChild($newInterfaceNode); > ?> <?php $newInterfaceNode->setAttribute("name", "dmz"); $newInterfaceNode->setAttribute("type", "ethernet"); $newInterfaceNode->setAttribute("device", "eth3"); $newInterfaceNode->setAttribute("ip", "xxxxx"); ?> the setAttribute method only works for appended nodes... you can get a peace of "technical" documentation of the used methods from http://www.eecoo.de/downloads/domdocumentation.txt . i'm happy being able to help you, maybe you'll help us later on;) bye.

« previous php.general (#179395) next »