|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-03-18 17:50 UTC] kdesormeaux at atre dot net
Here is the code:
$oDelete = explode(",", $HTTP_GET_VARS["nodeId"]);
$intDelete = count($oDelete);
$xmlDoc = @xmldocfile($xmlDataPath) or die("Couldn't get XML data");
$nodeRoot = $xmlDoc->root();
$childNodes = $nodeRoot->children();
echo $childNodes;
for ($i=0; $i < $intDelete; $i++){
$childNodes[$oDelete[$i]]->unlink();
}
$strWrite = domxml_dumpmem($xmlDoc);
$xmlFile = fopen($xmlDataFile,"w");
fwrite($xmlFile,$strWrite);
fclose($xmlFile);
exit;
OK, when $childNodes[$oDelete[$i]]->unlink();
gets executed it starts a system process php.exe. This process never ends. It deletes the node and writes the file but the process keeps running. If you delete another node by running unlink() again it starts a new php.exe process and that one keeps running.
Any ideas of other ways to remove a node from a xml file??
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 07 20:00:01 2025 UTC |
Windows2000 pro Here is the code: $oDelete = explode(",", $HTTP_GET_VARS["nodeId"]); $intDelete = count($oDelete); $xmlDoc = @xmldocfile($xmlDataPath) or die("Couldn't get XML data"); $nodeRoot = $xmlDoc->root(); $childNodes = $nodeRoot->children(); echo $childNodes; for ($i=0; $i < $intDelete; $i++){ $childNodes[$oDelete[$i]]->unlink(); } $strWrite = domxml_dumpmem($xmlDoc); $xmlFile = fopen($xmlDataFile,"w"); fwrite($xmlFile,$strWrite); fclose($xmlFile); exit; OK, when $childNodes[$oDelete[$i]]->unlink(); gets executed it starts a system process php.exe. This process never ends. It deletes the node and writes the file but the process keeps running. If you delete another node by running unlink() again it starts a new php.exe process and that one keeps running. Any ideas of other ways to remove a node from a xml file??