25 #include <libxml/parser.h>
26 #include <libxml/tree.h>
27 #include <libxml/xinclude.h>
100 for(; el; el = el->
next)
114 struct _xmlAttr *attr;
126 for (attr = ptr->properties; attr; attr = attr->next)
128 if (!xmlStrcmp(attr->name, BAD_CAST
"syntax") &&
129 attr->children && attr->children->type == XML_TEXT_NODE)
134 (
const char *) attr->children->content,
139 " unknown attribute value syntax='%s'",
140 (
const char *) attr->children->content);
144 else if (!xmlStrcmp(attr->name, BAD_CAST
"identifier") &&
145 attr->children && attr->children->type == XML_TEXT_NODE)
148 else if (!xmlStrcmp(attr->name, BAD_CAST
"name") &&
149 attr->children && attr->children->type == XML_TEXT_NODE)
155 " expected attributes 'syntax', identifier' or "
156 "'name', got '%s'", attr->name);
170 for (ptr = ptr->children; ptr; ptr = ptr->next)
172 if (ptr->type != XML_ELEMENT_NODE)
174 if (strcmp((
const char *) ptr->name,
"backend"))
177 " zero or one element <backend>, got <%s>",
178 (
const char *) ptr->name);
183 struct _xmlAttr *attr;
187 "only one <backend> allowed");
192 for (attr = ptr->properties; attr; attr = attr->next)
194 if (!xmlStrcmp(attr->name, BAD_CAST
"name")
196 && attr->children->type == XML_TEXT_NODE)
199 (
const char *) attr->children->content);
201 else if (!xmlStrcmp(attr->name, BAD_CAST
"syntax")
203 && attr->children->type == XML_TEXT_NODE)
209 (
const char *) attr->children->content,
214 "Element <backend syntax='%s'>: "
215 "attribute 'syntax' has invalid "
217 attr->children->content,
218 attr->children->content);
225 "attributes 'syntax' or 'name, got '%s'",
256 if (ptr && ptr->type == XML_ELEMENT_NODE &&
257 !strcmp((
const char *) ptr->name,
"retrievalinfo"))
259 for (ptr = ptr->children; ptr; ptr = ptr->next)
261 if (ptr->type != XML_ELEMENT_NODE)
263 if (!strcmp((
const char *) ptr->name,
"retrieval"))
271 "expected element <retrieval>, got <%s>",
291 const char *schema,
Odr_oid *syntax,
292 const char **match_schema,
Odr_oid **match_syntax,
294 const char **backend_schema,
298 int syntax_matches = 0;
299 int schema_matches = 0;
304 for(; el; el = el->
next)
330 if (syntax_ok && schema_ok)
332 *match_syntax = el->
syntax;
345 *backend_schema = el->
name;
347 *backend_schema = schema;
354 *backend_syntax = el->
syntax;
361 if (!syntax_matches && syntax)