You are here: Re: simplexml with xpath, getting index of results « PHP Programming Language « IT news, forums, messages
Re: simplexml with xpath, getting index of results

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация