tags:

views:

111

answers:

1

Hello everyone! I have the following code inside a class:

$tmp= $this->Xml->xpath("/page/text[@id='$this->Id']");
$tmp[0]= $this->Text;
echo $tmp[0];
echo $this->Xml->asXml();
$this->Xml->asXML($this->FileName); //save XML

the problem is "echo $tmp[0]" prints the updated text while $this->Xml->asXml() still contains the old node value. Searching around this website I found this to be the correct way to update the whole XML tree, yet this is still not working. Any idea?

Thanks

A: 
list( , $node) = each($tmp);
$node->asXML($this->FileName);
Zane Edward Dockery
why should this work?
Mokuchan