* Copyright (C) 2005-2006, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: retrieval.c,v 1.3 2006-05-07 14:48:25 adam Exp $
+ * $Id: retrieval.c,v 1.8 2006-05-09 11:09:09 mike Exp $
*/
/**
* \file retrieval.c
#include <yaz/tpath.h>
#include <yaz/proto.h>
-#if HAVE_XSLT
+#if HAVE_XML2
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <libxml/xinclude.h>
-#include <libxslt/xsltutils.h>
-#include <libxslt/transform.h>
/** \brief The internal structure for yaz_retrieval_t */
struct yaz_retrieval_struct {
}
if (!el->syntax)
{
- wrbuf_printf(p->wr_error, "Missing 'syntax' attribute.", attr->name);
+ wrbuf_printf(p->wr_error, "Missing 'syntax' attribute");
return -1;
}
int **backend_syntax)
{
struct yaz_retrieval_elem *el = p->list;
-
int syntax_matches = 0;
int schema_matches = 0;
+
+ wrbuf_rewind(p->wr_error);
+ if (!el)
+ return 0;
for(; el; el = el->next)
{
int schema_ok = 0;
schema_ok = 1;
if (!schema)
schema_ok = 1;
+ if (schema && !el->schema)
+ schema_ok = 1;
if (syntax && el->syntax && !oid_oidcmp(syntax, el->syntax))
syntax_ok = 1;
return 0;
}
}
- if (syntax_matches && !schema_matches)
- return 1;
- if (!syntax_matches && schema_matches)
+ if (!syntax_matches && syntax)
+ {
+ char buf[100];
+ wrbuf_printf(p->wr_error, "%s", oid_to_dotstring(syntax, buf));
return 2;
- if (!syntax_matches && !schema_matches)
- return 3;
- return 4;
+ }
+ if (schema)
+ wrbuf_printf(p->wr_error, "%s", schema);
+ if (!schema_matches)
+ return 1;
+ return 3;
}
const char *yaz_retrieval_get_error(yaz_retrieval_t p)