projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
match_xsd_string returns empty string rather than NULL for empty CDATA
[yaz-moved-to-github.git]
/
src
/
srw.c
diff --git
a/src/srw.c
b/src/srw.c
index
0461f2f
..
a01e1c2
100644
(file)
--- a/
src/srw.c
+++ b/
src/srw.c
@@
-1,8
+1,8
@@
/*
/*
- * Copyright (c) 2002-2004, Index Data.
+ * Copyright (c) 2002-2005, Index Data.
* See the file LICENSE for details.
*
* See the file LICENSE for details.
*
- * $Id: srw.c,v 1.29 2005-01-08 01:20:19 adam Exp $
+ * $Id: srw.c,v 1.32 2005-01-11 12:05:32 adam Exp $
*/
/**
* \file srw.c
*/
/**
* \file srw.c
@@
-95,7
+95,10
@@
static int match_xsd_string_n(xmlNodePtr ptr, const char *elem, ODR o,
#endif
ptr = ptr->children;
if (!ptr || ptr->type != XML_TEXT_NODE)
#endif
ptr = ptr->children;
if (!ptr || ptr->type != XML_TEXT_NODE)
- return 0;
+ {
+ *val = "";
+ return 1;
+ }
*val = odr_strdup(o, ptr->content);
if (len)
*len = strlen(ptr->content);
*val = odr_strdup(o, ptr->content);
if (len)
*len = strlen(ptr->content);
@@
-353,6
+356,7
@@
static int yaz_srw_term(ODR o, xmlNodePtr pptr, Z_SRW_scanTerm *term,
term->value = 0;
term->numberOfRecords = 0;
term->displayTerm = 0;
term->value = 0;
term->numberOfRecords = 0;
term->displayTerm = 0;
+ term->whereInList = 0;
for (ptr = pptr->children; ptr; ptr = ptr->next)
{
if (match_xsd_string(ptr, "value", o, &term->value))
for (ptr = pptr->children; ptr; ptr = ptr->next)
{
if (match_xsd_string(ptr, "value", o, &term->value))
@@
-363,14
+367,18
@@
static int yaz_srw_term(ODR o, xmlNodePtr pptr, Z_SRW_scanTerm *term,
else if (match_xsd_string(ptr, "displayTerm", o,
&term->displayTerm))
;
else if (match_xsd_string(ptr, "displayTerm", o,
&term->displayTerm))
;
+ else if (match_xsd_string(ptr, "whereInList", o,
+ &term->whereInList))
+ ;
}
}
else if (o->direction == ODR_ENCODE)
{
xmlNodePtr ptr = pptr;
add_xsd_string(ptr, "value", term->value);
}
}
else if (o->direction == ODR_ENCODE)
{
xmlNodePtr ptr = pptr;
add_xsd_string(ptr, "value", term->value);
- add_xsd_integer(ptr, "value", term->numberOfRecords);
+ add_xsd_integer(ptr, "numberOfRecords", term->numberOfRecords);
add_xsd_string(ptr, "displayTerm", term->displayTerm);
add_xsd_string(ptr, "displayTerm", term->displayTerm);
+ add_xsd_string(ptr, "whereInList", term->whereInList);
}
return 0;
}
}
return 0;
}
@@
-620,6
+628,11
@@
int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
else if (match_xsd_string(ptr, "scanClause", o,
&req->scanClause.cql))
;
else if (match_xsd_string(ptr, "scanClause", o,
&req->scanClause.cql))
;
+ else if (match_xsd_string(ptr, "pScanClause", o,
+ &req->scanClause.pqf))
+ {
+ req->query_type = Z_SRW_query_type_pqf;
+ }
else if (match_xsd_integer(ptr, "responsePosition", o,
&req->responsePosition))
;
else if (match_xsd_integer(ptr, "responsePosition", o,
&req->responsePosition))
;