note 71959 added to function.domnode-set-content
| From: | t_0_wolf at hotmail dot com | Date: | Tue, 26 Dec 2006 09:02:39 +0000 |
| Subject: | note 71959 added to function.domnode-set-content | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-120917@lists.php.net to get a copy of this message | ||
the XML file i wanna to edit is showing below :
<map name="write-processors">
<newObject name="Archiver"
class="org.archive.crawler.writer.ARCWriterProcessor">
<boolean name="enabled">true</boolean>
<map name="filters">
</map>
<boolean name="compress">true</boolean>
<string name="prefix">blog22</string>
<string name="suffix">apache_user</string>
<integer name="max-size-bytes">100000000</integer>
<stringList name="path">
<string>arcs</string>
</stringList>
<integer name="pool-max-active">5</integer>
<integer name="pool-max-wait">300000</integer>
<long name="total-bytes-to-write">0</long>
</newObject>
</map>
i want to change the value of the blog and apache_user
<string name="prefix">blog</string>
<string name="suffix">apache_user</string>
i am using the codes to do the job, but seems it doesn't work..
$node_array = $dom->get_elements_by_tagname("string");
foreach($node_array as $node) {
$element = $node;
$value = $element->get_attribute("name");
#echo "Attribute name: ", $value ,"<br>";
if( $value == "prefix"){
#echo "....";
#echo $valule;
$content="temp";
$name_text_node = $element->first_child();
echo $name_text_node->get_content();
echo "<br>";
$name_text_node->set_content($content);
echo $name_text_node->get_content();
echo "<br>";
}
in the browser, it display that the content have been changed, but the related opened file is not
changed.
----
Server IP: 202.79.178.91
Probable Submitter: 155.69.5.236 (proxied: 155.69.148.38)
----
Manual Page -- http://www.php.net/manual/en/function.domnode-set-content.php
Edit -- https://master.php.net/note/edit/71959
Del: integrated -- https://master.php.net/note/delete/71959/integrated
Del: useless -- https://master.php.net/note/delete/71959/useless
Del: bad code -- https://master.php.net/note/delete/71959/bad+code
Del: spam -- https://master.php.net/note/delete/71959/spam
Del: non-english -- https://master.php.net/note/delete/71959/non-english
Del: in docs -- https://master.php.net/note/delete/71959/in+docs
Del: other reasons-- https://master.php.net/note/delete/71959
Reject -- https://master.php.net/note/reject/71959
Search -- https://master.php.net/manage/user-notes.php