|
Posted by sugoi.sama on 01/02/06 14:26
That doesn't solve my problem.
I guess i didn't explain myself very well...
------------------------ MY XML FILE:
.....
xmlns:lib="http://en.wikipedia.org/wiki/Manga"
.....
<lib:manga title="Fullmetal">
<numVolumes>14</numVolumes>
</lib:manga>
.....
-------------------------
by doing this:
++++++++++++++++++++++++++++++
$mangaLib = simplexml_load_file($mangaLibFile);
$mangaObj = $mangaLib->children($mangaURI);
$tmp = $mangaObj->xpath('//numVolumes[../@title="'.$title.'"]');
var_dump($tmp);
++++++++++++++++++++++++++++++
i get:
---++++++++++---
array(1) {
[0]=>
object(SimpleXMLElement)#18 (1) {
[0]=>
string(2) "14" // <numVolumes>14</numVolumes>
}
}
---++++++++++---
What i want to do is, change <numVolumes> from 14, to some other value!
So i would do this:
$mangaObj->manga[$INDEX]->numVolumes = 12345;
But to accomplish that, i need to know the value of $INDEX, am i
correct or is there other way?
Because i simply can't do anything with $tmp!!! I can't access it and
change it's value! (and i'm assuming it's a reference)
I can't do this: $tmp[0]->object[0] = 12345;
(this doesn't even make sense)
How can i change <numVolumes> value?
thanks in advance
Navigation:
[Reply to this message]
|