I want to modify my xml file in PHP based on the following criteria.
my xml structure look like this:
preserveWhiteSpace = FALSE;
$xml->load("markers.xml");
$mar = $xml->getElementsByTagName("marker");
foreach($mar as $row){
$type = $row->getElementsByTagName('type')->item(0);
$title = $row->getElementsByTagName('title')->item(0);
$address = $row->getElementsByTagName('address')->item(0);
$latitude = $row->getElementsByTagName('latitude')->item(0);
$longitude = $row->getElementsByTagName('longitude')->item(0);
$row->replaceChild($type, $type);
$row->replaceChild($title, $title);
$row->replaceChild($address, $address);
$row->replaceChild($latitude, $latitude);
$row->replaceChild($longitude, $longitude);
?>
nodeValue = $_POST['type'];
$text->nodeValue = $_POST['text'];
$address->nodeValue = $_POST['address'];
$latitude->nodeValue = $_POST['latitude'];
$longitude->nodeValue = $_POST['longitude'];
$xml->save("markers.xml");
}
}
?>