PHP5 SimpleXML (problem editing XML)
Hello all, I have a XML file with the following contents:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?> Code:
$xml = simplexml_load_file('./languages/en.xml') or die ("Unable to load XML file!"); Code:
$xml = simplexml_load_file('./languages/en.xml') or die ("Unable to load XML file!"); Code:
$xml = simplexml_load_file('./languages/en.xml') or die ("Unable to load XML file!"); Thank you very much for your help. |
Well it seems that it is not possible to edit the values of a xml entry, from the results of xpath, so here is what I am doing:
Code:
function xml_edit_value($object_data, $xpath_expression, $attribute_name, $attribute_value, $replace_string){ $xml = simplexml_load_file('./test.xml') or die ("Unable to load XML file!"); xml_edit_value($xml, '//page[@id="applications"]', 'id', 'test_system', 'new value here'); now it can be saved etc. hope it helps. |
All times are GMT -5. The time now is 04:58 PM. |