2013-09-23 29 views

回答

0
$xml->asXML('old.xml'); 

foreach ($xml->xpath('ns:foo') as $foo) { 
    $foo['attribute'] = 'new bar'; 
    $foo[0] = 'NEW TEXT DATA'; 
} 

$xml->asXML('new.xml'); 
相关问题