|
Posted by Janwillem Borleffs on 01/02/06 13:39
sugoi.sama@gmail.com wrote:
> i really don't care about the "id" node value, what i want is its
> position, but PHP complained if i used it without id:
> $tmp = $mangaObj->xpath('//[../@title="'.$title.'"][position()]');
>
> isn't position() supposed to return the index i want?!
>
PHP's complaining about the invalid use of the position() function. Any of
the following would be valid:
//*[../@title="'.$title.'"][position() = 1]
//*[position() = 1]
//*[../@title="'.$title.'"][1]
//*[1]
JW
Navigation:
[Reply to this message]
|