PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<yaz_ccl_confyaz_close>
view the version of this page
Last updated: Thu, 21 Aug 2003

yaz_ccl_parse

(PHP 4 >= 4.0.5)

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. If the supplied query was successfully converted to RPN, this function returns TRUE, and the index rpn of the supplied array result holds a valid RPN query. If the query could not be converted (because of invalid syntax, unknown field, etc.) this function returns FALSE and three indexes are set in the resulting array to indicate the cause of failure: errorcode CCL error code (integer), errorstring CCL error string, and errorpos approximate position in query of failure (integer is character position).

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 note add a note User Contributed Notes
yaz_ccl_parse
There are no user contributed notes for this page.

<yaz_ccl_confyaz_close>
 Last updated: Thu, 21 Aug 2003
show source | credits | sitemap | mirror sites 
Copyright © 2001-2003 The PHP Group
All rights reserved.
This mirror generously provided by: http://php.mirrors.ilisys.com.au/
Last updated: Sat 01 Nov 2003 04:13:36 EST EST