-/* $Id: cqltransform.c,v 1.1 2003-10-27 12:21:30 adam Exp $
+/* $Id: cqltransform.c,v 1.4 2003-12-18 16:59:28 mike Exp $
Copyright (C) 2002-2003
Index Data Aps
}
return 0;
}
- /* 4. lookup qualifier.prefix. */
+ /* 4. lookup index.prefix. */
cp = cn->u.st.index;
cp_dot = strchr(cp, '.');
char n_full[64];
sprintf (n_full, "%.20s.%.40s", n_prefix, n_suffix);
- if (!strcmp(ns, "http://www.loc.gov/zing/cql/srw-indexes/v1.0/")
+ if ((!strcmp(ns, "http://www.loc.gov/zing/cql/context-sets/cql/v1.1/") ||
+ !strcmp(ns, "http://www.loc.gov/zing/cql/srw-indexes/v1.0/"))
&& !strcmp(n_suffix, "resultSet"))
{
(*pr)("@set \"", client_data);
(*pr)("\" ", client_data);
return ;
}
- cql_pr_attr(ct, "qualifier.", n_full, "srw.serverChoice",
- pr, client_data, 16);
+ if (!cql_pr_attr(ct, "index.", n_full, "cql.serverChoice",
+ pr, client_data, 16)) {
+ /* No index.foo; reset error and fall back to qualifier.foo */
+ if (ct->error == 16) ct->error = 0;
+ cql_pr_attr(ct, "qualifier.", n_full, "cql.serverChoice",
+ pr, client_data, 16);
+ }
}
if (cn->u.st.relation && !strcmp(cn->u.st.relation, "="))