hi experts,
does nodeValue only work with XML files that have a structure like this:
[CODE]<title>The Brief Wondrous Life of Oscar Wao</title>
<author>Junot Diaz</author>
<publisher>Riverhead Hardcover</publisher>
i have a XML file with a structure like the one below and i need to write a PHP script that looks for all the <page value=”nnn”/> and substracts 2. so in the example below 189 becomes 187, 419 becomes 417.
[CODE]<area coords=”179,115,198,127″ id=”7″ type=”rect”>
<highlight_behaviour id=”jump2page”/>
<click_behaviour id=”jump2page”/>
<page value=”189″/>
</area>
<area coords=”204,115,223,127″ id=”8″ type=”rect”>
<highlight_behaviour id=”jump2page”/>
<click_behaviour id=”jump2page”/>
<page value=”419″/>
</area>
this doesn´t work:
[code=php]$pages = $xpath->query(‘area/page’);
foreach($pages as $page)
{
$pagenumber = $page->nodeValue;
$page->nodeValue = (int)$pagenumber-2;
}
any ideas?
best,
jogol