downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  

<yaz_ccl_confyaz_close>
Last updated: Thu, 26 Jun 2008

yaz_ccl_parse

(PHP 4 >= 4.0.5, PECL yaz:0.9-1.0.9)

yaz_ccl_parse — Invoke CCL Parser

Description

bool yaz_ccl_parse ( resource $id , string $query , array &$result )

This function invokes a CCL parser. It converts a given CCL FIND query to an RPN query which may be passed to the yaz_search() function to perform a search.

To define a set of valid CCL fields call yaz_ccl_conf() prior to this function.

Parameters

id

The connection resource returned by yaz_connect().

query

The CCL FIND query.

result

If the function was executed successfully, this will be an array containing the valid RPN query under the key rpn.

Upon failure, three indexes are set in this array to indicate the cause of failure:

  • errorcode - the CCL error code (integer)

  • errorstring - the CCL error string

  • errorpos - approximate position in query of failure (integer is character position)

Return Values

Returns TRUE on success or FALSE on failure.

Examples

Example #1 CCL Parsing

We will try to search using CCL. In the example below, $ccl is a CCL query.

<?php

yaz_ccl_conf
($id, $fields);  // see example for yaz_ccl_conf
if (!yaz_ccl_parse($id, $ccl, &$cclresult)) {
   echo
'Error: ' . $cclresult["errorstring"];
} else {
  
$rpn = $cclresult["rpn"];
  
yaz_search($id, "rpn", $rpn);
}
?>


add a noteadd a note User Contributed Notes
Invoke CCL Parser
There are no user contributed notes for this page.




<yaz_ccl_confyaz_close>
Last updated: Thu, 26 Jun 2008
show source | credits | sitemap | contact | advertising | mirror sites
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://phpbuilder.com/
Last updated: Tue Nov 1 20:20:59 2005 EST
Columns / Articles | Tips / Quickies | News | News Linking and RSS Feeds | Shared Code Library
Mail Archives | Support / Discussion Forums | Get Started! Links | Contribute! | Docs