store->delete($key)){ header("HTTP/1.1 200 OK", 200); return; } else { header("HTTP/1.1 403 Forbidden", 403); return; } } else { // Attempt to fetch an existing document at this key. list($orig_doc, $orig_root_node) = fetchOutlineWithSelector($key, $selector); // Ensure selected suboutline exists, if selector present. if ($selector && !$orig_doc) { return $driver->showErrorTextResponse(400, "Document not found, or suboutline selector invalid for ". "DELETE on new document."); } // Delete the selected node. $orig_root_node->parentNode->removeChild($orig_root_node); // Attempt to store the modified document. if (FALSE !== $driver->store->put($key, $orig_doc->saveXML())) { header("HTTP/1.1 200 OK", 200); return; } else { return $driver->show403(); } } ?>