From: MARTIN JC <jcm...@en...> - 2005-03-11 14:20:51
|
Hi, thanks, it works great now ! I'll send a working file soon, so anybody interested will see how to=20 manage to run eXist queries with php. (it was not so hard, anyway) Or maybe it's not the correct place to send such things ?? JC Wolfgang Meier a =E9crit : >> $db =3D new eXist($path,$server,$port); >> $query=3D"document()//title"; $query=3Dbase64_encode($query); >> $queryResponse =3D $db->executeQuery($query); >> >> 1) how can I access the result of this query ? >> I used the $arguments=3Darray('/_xml' =3D> $queryResponse,); that I ha= d=20 >> found in a previous version of the exist class but it always gives me=20 >> a null result. > > > executeQuery() just returns an integer handle. You can use this handle=20 > with getHits() to get the number of hits and retrieve() to get the=20 > actual results. > > But don't ask me how to do this in PHP. I'm a PHP illiterate, so I=20 > can't help much here. > >> 2) How can I check if the query has been executed correctly or no ?=20 >> (that's could be useful before trying to access the result :D ) >> >> when I try to xslt_process the result, I get this error* >> Warning*: Sablotron error on line 1: XML parser error 3: no element=20 >> found in *phpexist.php* on line *35* >> Error:: error code is 2 >> >> I also return the $db->error string : >> org.exist.EXistException: unexpected token: null [at line 1, column=20 >> 25] org.exist.xquery.XPathException: unexpected token: null [at line=20 >> 1, column 25] at org.exist.xquery.XQuery.compile(XQuery.java:97) at=20 > > > This indicates an error in your query. The xquery parser waits to see=20 > some final token, but finds EOF instead. Please check the log files of=20 > eXist to see if your query correctly arrives at the server. > > Wolfgang > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick > _______________________________________________ > Exist-open mailing list > Exi...@li... > https://lists.sourceforge.net/lists/listinfo/exist-open > > |