The following code returns a permisson error:
Quote:
Warning: DOMDocument::save(./save1.xml) [function.DOMDocument-save]:
failed to open stream: Permission denied in /Users/username/Sites/
xmlphp/dom/appendData/appendData.php on line 17
DOMCharacterData->appendData example
I attempted changing the owner of each file to System and read/write
for each file, with the same result, MAC OS 10.4.8, without success,
what steps are needed to correct this?
This source returned for the remote server(http://bushidodeep.com/php/
dom/appendData/appendData.php):
<b>DOMCharacterData->appendData example</b>
<?php
$doc = new DomDocument;
//Load the xml file into DOMDocument
$doc->Load('./employee.xml');
//We retreive the attibute named id of the employee element
$employee = $doc->getElementsByTagName('employee')->item(0);
//Create a New element
$newElement = $doc->createElement('surname');
//Create a text node
$textNode = $doc->createTextNode("Text Node Created");
//Append the Text Node into the newly created node.
$newElement -> appendChild($textNode);
//Append the new element to the employee element
$employee -> appendChild($newElement);
//Save the DOMDocument into a file.
$test = $doc->save("./save1.xml");
echo "<b>DOMCharacterData->appendData example</b>"
?>
Return True,
.........
PHP
Version 5.1.4
MySQL
Client API version 5.0.19
..........
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php