Refactor Pazpar2 HTTP response writing code
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 30 Sep 2011 12:47:54 +0000 (14:47 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 30 Sep 2011 12:47:54 +0000 (14:47 +0200)
Header and footer for successful responses is handled by a
command handler. This makes the formatting slightly different.
It also fixes the termlist response which did not include the
XML header before.

37 files changed:
src/http_command.c
test/test_http_10.res
test/test_http_11.res
test/test_http_13.res
test/test_http_14.res
test/test_http_18.res
test/test_http_23.res
test/test_http_28.res
test/test_http_32.res
test/test_http_36.res
test/test_http_41.res
test/test_http_42.res
test/test_http_45.res
test/test_http_49.res
test/test_http_5.res
test/test_http_50.res
test/test_http_55.res
test/test_http_57.res
test/test_http_6.res
test/test_http_60.res
test/test_http_63.res
test/test_http_8.res
test/test_http_9.res
test/test_icu_10.res
test/test_icu_4.res
test/test_icu_5.res
test/test_icu_6.res
test/test_icu_7.res
test/test_icu_8.res
test/test_icu_9.res
test/test_post_10.res
test/test_post_8.res
test/test_post_9.res
test/test_solr_4.res
test/test_solr_5.res
test/test_turbomarcxml_4.res
test/test_turbomarcxml_7.res

index 07e37be..7f7f98a 100644 (file)
@@ -267,6 +267,28 @@ static void error(struct http_response *rs,
     http_send_response(c);
 }
 
+static void response_open_no_status(struct http_channel *c, const char *command)
+{
+    wrbuf_rewind(c->wrbuf);
+    wrbuf_printf(c->wrbuf, "%s<%s>",
+                 HTTP_COMMAND_RESPONSE_PREFIX, command);
+}
+
+static void response_open(struct http_channel *c, const char *command)
+{
+    response_open_no_status(c, command);
+    wrbuf_puts(c->wrbuf, "<status>OK</status>");
+}
+
+static void response_close(struct http_channel *c, const char *command)
+{
+    struct http_response *rs = c->response;
+
+    wrbuf_printf(c->wrbuf, "</%s>", command);
+    rs->payload = nmem_strdup(c->nmem, wrbuf_cstr(c->wrbuf));
+    http_send_response(c);
+}
+
 unsigned int make_sessionid(void)
 {
     static int seq = 0; /* thread pr */
@@ -368,18 +390,15 @@ static int process_settings(struct session *se, struct http_request *rq,
 
 static void cmd_exit(struct http_channel *c)
 {
-    char buf[1024];
-    struct http_response *rs = c->response;
     yaz_log(YLOG_WARN, "exit");
-    sprintf(buf, HTTP_COMMAND_RESPONSE_PREFIX "<exit><status>OK</status></exit>");
-    rs->payload = nmem_strdup(c->nmem, buf);
-    http_send_response(c);
+
+    response_open(c, "exit");
+    response_close(c, "exit");
     http_close_server(c->server);
 }
 
 static void cmd_init(struct http_channel *c)
 {
-    char buf[1024];
     struct http_request *r = c->request;
     const char *clear = http_argbyname(r, "clear");
     const char *content_type = http_lookup_header(r->headers, "Content-Type");
@@ -429,18 +448,18 @@ static void cmd_init(struct http_channel *c)
     
     if (process_settings(s->psession, c->request, c->response) < 0)
         return;
-    
-    sprintf(buf, HTTP_COMMAND_RESPONSE_PREFIX 
-            "<init><status>OK</status><session>%d", sesid);
+
+    response_open(c, "init");
+    wrbuf_printf(c->wrbuf, "<session>%d", sesid);
     if (c->server->server_id)
     {
-        strcat(buf, ".");
-        strcat(buf, c->server->server_id);
+        wrbuf_puts(c->wrbuf, ".");
+        wrbuf_puts(c->wrbuf, c->server->server_id);
     }
-    strcat(buf, "</session>"
-           "<protocol>" PAZPAR2_PROTOCOL_VERSION "</protocol></init>");
-    rs->payload = nmem_strdup(c->nmem, buf);
-    http_send_response(c);
+    wrbuf_puts(c->wrbuf, "</session>"
+               "<protocol>" PAZPAR2_PROTOCOL_VERSION "</protocol>");
+    
+    response_close(c, "init");
 }
 
 static void apply_local_setting(void *client_data,
@@ -484,14 +503,13 @@ static void cmd_settings(struct http_channel *c)
         release_session(c, s);
         return;
     }
-    rs->payload = HTTP_COMMAND_RESPONSE_PREFIX "<settings><status>OK</status></settings>";
-    http_send_response(c);
+    response_open(c, "settings");
+    response_close(c, "settings");
     release_session(c, s);
 }
 
 static void cmd_termlist(struct http_channel *c)
 {
-    struct http_response *rs = c->response;
     struct http_request *rq = c->request;
     struct http_session *s = locate_session(c);
     const char *name = http_argbyname(rq, "name");
@@ -507,16 +525,12 @@ static void cmd_termlist(struct http_channel *c)
     if (nums)
         num = atoi(nums);
 
-    wrbuf_rewind(c->wrbuf);
-
-    wrbuf_puts(c->wrbuf, "<termlist>\n");
+    response_open_no_status(c, "termlist");
     wrbuf_printf(c->wrbuf, "<activeclients>%d</activeclients>\n", status);
 
     perform_termlist(c, s->psession, name, num);
 
-    wrbuf_puts(c->wrbuf, "</termlist>\n");
-    rs->payload = nmem_strdup(rq->channel->nmem, wrbuf_cstr(c->wrbuf));
-    http_send_response(c);
+    response_close(c, "termlist");
     release_session(c, s);
 }
 
@@ -533,19 +547,14 @@ static void session_status(struct http_channel *c, struct http_session *s)
 
 static void cmd_session_status(struct http_channel *c)
 {
-    struct http_response *rs = c->response;
     struct http_session *s = locate_session(c);
     if (!s)
         return;
 
-    wrbuf_rewind(c->wrbuf);
-    wrbuf_puts(c->wrbuf, HTTP_COMMAND_RESPONSE_PREFIX "<sessionstatus><status>OK</status>\n");
+    response_open(c, "session-status");
     session_status(c, s);
-    wrbuf_puts(c->wrbuf, "</sessionstatus>\n");
-    rs->payload = nmem_strdup(c->nmem, wrbuf_cstr(c->wrbuf));
-    http_send_response(c);
+    response_close(c, "session-status");
     release_session(c, s);
-
 }
 
 int sessions_count(void);
@@ -558,13 +567,12 @@ int resultsets_count(void);
 
 static void cmd_server_status(struct http_channel *c)
 {
-    struct http_response *rs = c->response;
     int sessions   = sessions_count();
     int clients    = clients_count();
     int resultsets = resultsets_count();
-    wrbuf_rewind(c->wrbuf);
-    wrbuf_puts(c->wrbuf, HTTP_COMMAND_RESPONSE_PREFIX "<server-status>\n");
-    wrbuf_printf(c->wrbuf, "  <sessions>%u</sessions>\n", sessions);
+
+    response_open(c, "server-status");
+    wrbuf_printf(c->wrbuf, "\n  <sessions>%u</sessions>\n", sessions);
     wrbuf_printf(c->wrbuf, "  <clients>%u</clients>\n",   clients);
     /* Only works if yaz has been compiled with enabling of this */
     wrbuf_printf(c->wrbuf, "  <resultsets>%u</resultsets>\n",resultsets);
@@ -588,16 +596,13 @@ static void cmd_server_status(struct http_channel *c)
     }
     yaz_mutex_leave(http_sessions->mutex);
 */
-    wrbuf_puts(c->wrbuf, "</server-status>\n");
-    rs->payload = nmem_strdup(c->nmem, wrbuf_cstr(c->wrbuf));
-    http_send_response(c);
+    response_close(c, "server-status");
     xmalloc_trav(0);
 }
 
 
 static void cmd_bytarget(struct http_channel *c)
 {
-    struct http_response *rs = c->response;
     struct http_request *rq = c->request;
     struct http_session *s = locate_session(c);
     struct hitsbytarget *ht;
@@ -607,8 +612,7 @@ static void cmd_bytarget(struct http_channel *c)
     if (!s)
         return;
     ht = get_hitsbytarget(s->psession, &count, c->nmem);
-    wrbuf_rewind(c->wrbuf);
-    wrbuf_puts(c->wrbuf, HTTP_COMMAND_RESPONSE_PREFIX "<bytarget><status>OK</status>");
+    response_open(c, "bytarget");
 
     for (i = 0; i < count; i++)
     {
@@ -640,10 +644,7 @@ static void cmd_bytarget(struct http_channel *c)
         }
         wrbuf_puts(c->wrbuf, "</target>");
     }
-
-    wrbuf_puts(c->wrbuf, "</bytarget>");
-    rs->payload = nmem_strdup(c->nmem, wrbuf_cstr(c->wrbuf));
-    http_send_response(c);
+    response_close(c, "bytarget");
     release_session(c, s);
 }
 
@@ -829,8 +830,8 @@ static void cmd_record(struct http_channel *c)
     }
     else
     {
-        wrbuf_puts(c->wrbuf, HTTP_COMMAND_RESPONSE_PREFIX "<record>\n");
-        wrbuf_puts(c->wrbuf, "<recid>");
+        response_open_no_status(c, "record");
+        wrbuf_puts(c->wrbuf, "\n<recid>");
         wrbuf_xmlputs(c->wrbuf, rec->recid);
         wrbuf_puts(c->wrbuf, "</recid>\n");
         if (prev_r)
@@ -850,9 +851,7 @@ static void cmd_record(struct http_channel *c)
         write_metadata(c->wrbuf, service, rec->metadata, 1);
         for (r = rec->records; r; r = r->next)
             write_subrecord(r, c->wrbuf, service, 1);
-        wrbuf_puts(c->wrbuf, "</record>\n");
-        rs->payload = nmem_strdup(c->nmem, wrbuf_cstr(c->wrbuf));
-        http_send_response(c);
+        response_close(c, "record");
     }
     show_single_stop(s->psession, rec);
     release_session(c, s);
@@ -904,9 +903,8 @@ static void show_records(struct http_channel *c, int active)
     
     rl = show_range_start(s->psession, sp, startn, &numn, &total, &total_hits);
 
-    wrbuf_rewind(c->wrbuf);
-    wrbuf_puts(c->wrbuf, HTTP_COMMAND_RESPONSE_PREFIX "<show>\n<status>OK</status>\n");
-    wrbuf_printf(c->wrbuf, "<activeclients>%d</activeclients>\n", active);
+    response_open(c, "show");
+    wrbuf_printf(c->wrbuf, "\n<activeclients>%d</activeclients>\n", active);
     wrbuf_printf(c->wrbuf, "<merged>%d</merged>\n", total);
     wrbuf_printf(c->wrbuf, "<total>" ODR_INT_PRINTF "</total>\n", total_hits);
     wrbuf_printf(c->wrbuf, "<start>%d</start>\n", startn);
@@ -936,9 +934,7 @@ static void show_records(struct http_channel *c, int active)
 
     show_range_stop(s->psession, rl);
 
-    wrbuf_puts(c->wrbuf, "</show>\n");
-    rs->payload = nmem_strdup(c->nmem, wrbuf_cstr(c->wrbuf));
-    http_send_response(c);
+    response_close(c, "show");
     release_session(c, s);
 }
 
@@ -994,12 +990,11 @@ static void cmd_show(struct http_channel *c)
 
 static void cmd_ping(struct http_channel *c)
 {
-    struct http_response *rs = c->response;
     struct http_session *s = locate_session(c);
     if (!s)
         return;
-    rs->payload = HTTP_COMMAND_RESPONSE_PREFIX "<ping><status>OK</status></ping>";
-    http_send_response(c);
+    response_open(c, "ping");
+    response_close(c, "ping");
     release_session(c, s);
 }
 
@@ -1038,7 +1033,8 @@ static void cmd_search(struct http_channel *c)
         release_session(c, s);
         return;
     }
-    rs->payload = HTTP_COMMAND_RESPONSE_PREFIX "<search><status>OK</status></search>";
+    response_open(c, "search");
+    response_close(c, "search");
     http_send_response(c);
     release_session(c, s);
 }
@@ -1046,7 +1042,6 @@ static void cmd_search(struct http_channel *c)
 
 static void cmd_stat(struct http_channel *c)
 {
-    struct http_response *rs = c->response;
     struct http_session *s = locate_session(c);
     struct statistics stat;
     int clients;
@@ -1064,8 +1059,7 @@ static void cmd_stat(struct http_channel *c)
        progress = (stat.num_clients  - clients) / (float)stat.num_clients;
     }
 
-    wrbuf_rewind(c->wrbuf);
-    wrbuf_puts(c->wrbuf, HTTP_COMMAND_RESPONSE_PREFIX "<stat>");
+    response_open_no_status(c, "stat");
     wrbuf_printf(c->wrbuf, "<activeclients>%d</activeclients>\n", clients);
     wrbuf_printf(c->wrbuf, "<hits>" ODR_INT_PRINTF "</hits>\n", stat.num_hits);
     wrbuf_printf(c->wrbuf, "<records>%d</records>\n", stat.num_records);
@@ -1077,19 +1071,15 @@ static void cmd_stat(struct http_channel *c)
     wrbuf_printf(c->wrbuf, "<failed>%d</failed>\n", stat.num_failed);
     wrbuf_printf(c->wrbuf, "<error>%d</error>\n", stat.num_error);
     wrbuf_printf(c->wrbuf, "<progress>%.2f</progress>\n", progress);
-    wrbuf_puts(c->wrbuf, "</stat>");
-    rs->payload = nmem_strdup(c->nmem, wrbuf_cstr(c->wrbuf));
-    http_send_response(c);
+    response_close(c, "stat");
     release_session(c, s);
 }
 
 static void cmd_info(struct http_channel *c)
 {
     char yaz_version_str[20];
-    struct http_response *rs = c->response;
 
-    wrbuf_rewind(c->wrbuf);
-    wrbuf_puts(c->wrbuf, HTTP_COMMAND_RESPONSE_PREFIX "<info>\n");
+    response_open_no_status(c, "info");
     wrbuf_puts(c->wrbuf, " <version>\n");
     wrbuf_puts(c->wrbuf, "  <pazpar2");
 #ifdef PAZPAR2_VERSION_SHA1
@@ -1099,7 +1089,6 @@ static void cmd_info(struct http_channel *c)
     wrbuf_xmlputs(c->wrbuf, VERSION);
     wrbuf_puts(c->wrbuf, "</pazpar2>");
 
-
     yaz_version(yaz_version_str, 0);
     wrbuf_puts(c->wrbuf, "  <yaz compiled=\"");
     wrbuf_xmlputs(c->wrbuf, YAZ_VERSION);
@@ -1111,9 +1100,7 @@ static void cmd_info(struct http_channel *c)
     
     info_services(c->server, c->wrbuf);
 
-    wrbuf_puts(c->wrbuf, "</info>");
-    rs->payload = nmem_strdup(c->nmem, wrbuf_cstr(c->wrbuf));
-    http_send_response(c);
+    response_close(c, "info");
 }
 
 struct {
index 90fd4e3..50f1703 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>9</merged>
 <total>10</total>
 <count>2</count>
 <recid>title how to program a computer author jack collins medium book</recid>
 </hit>
-</show>
+</show>
\ No newline at end of file
index 703dcfe..863b4ea 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>9</merged>
 <total>10</total>
 <count>2</count>
 <recid>title how to program a computer author jack collins medium book</recid>
 </hit>
-</show>
+</show>
\ No newline at end of file
index d3b889f..5a1147b 100644 (file)
@@ -1,9 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>0</merged>
 <total>0</total>
 <start>0</start>
 <num>0</num>
-</show>
+</show>
\ No newline at end of file
index d3b889f..5a1147b 100644 (file)
@@ -1,9 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>0</merged>
 <total>0</total>
 <start>0</start>
 <num>0</num>
-</show>
+</show>
\ No newline at end of file
index 267fde6..adb2f54 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>3</merged>
 <total>3</total>
@@ -42,4 +41,4 @@
 <relevance>0</relevance>
 <recid>title oil gas drilling author medium book</recid>
 </hit>
-</show>
+</show>
\ No newline at end of file
index a3476cd..6474b47 100644 (file)
@@ -23,4 +23,4 @@
 <md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
 <md-test-usersetting-2>test-usersetting-2 data: 
         YYYYYYYYY</md-test-usersetting-2></location>
-</record>
+</record>
\ No newline at end of file
index fdb5227..81731ab 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>3</merged>
 <total>17</total>
@@ -27,4 +26,4 @@
 <relevance>100000</relevance>
 <recid>title utah geological and mineral survey publications author medium book</recid>
 </hit>
-</show>
+</show>
\ No newline at end of file
index 5c85987..20c400e 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>3</merged>
 <total>3</total>
@@ -33,4 +32,4 @@
 <relevance>0</relevance>
 <recid>title oil gas drilling</recid>
 </hit>
-</show>
+</show>
\ No newline at end of file
index 6905e5a..f2a4386 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>8</merged>
 <total>10</total>
 <relevance>0</relevance>
 <recid>title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book</recid>
 </hit>
-</show>
+</show>
\ No newline at end of file
index ac7cb04..b5caef0 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>8</merged>
 <total>31</total>
@@ -62,4 +61,4 @@
 <relevance>0</relevance>
 <recid>title utah geological and mineral survey publications author medium book</recid>
 </hit>
-</show>
+</show>
\ No newline at end of file
index 9893c49..698b783 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>5</merged>
 <total>12</total>
@@ -86,4 +85,4 @@
 <relevance>35714</relevance>
 <recid>title computer science technology author medium book</recid>
 </hit>
-</show>
+</show>
\ No newline at end of file
index 2b89580..409826d 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>1</merged>
 <total>1</total>
@@ -22,4 +21,4 @@
 <relevance>0</relevance>
 <recid>title computer processing of dynamic images from an anger scintillation camera author medium book</recid>
 </hit>
-</show>
+</show>
\ No newline at end of file
index 43fcf8b..adc14ce 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>1</merged>
 <total>1</total>
@@ -23,4 +22,4 @@
 <relevance>120000</relevance>
 <recid>title the religious teachers of greece author adam james medium book</recid>
 </hit>
-</show>
+</show>
\ No newline at end of file
index a884f56..6cdfcf5 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>9</merged>
 <total>10</total>
 <relevance>0</relevance>
 <recid>title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book</recid>
 </hit>
-</show>
+</show>
\ No newline at end of file
index 2b89580..409826d 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>1</merged>
 <total>1</total>
@@ -22,4 +21,4 @@
 <relevance>0</relevance>
 <recid>title computer processing of dynamic images from an anger scintillation camera author medium book</recid>
 </hit>
-</show>
+</show>
\ No newline at end of file
index d3b889f..5a1147b 100644 (file)
@@ -1,9 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>0</merged>
 <total>0</total>
 <start>0</start>
 <num>0</num>
-</show>
+</show>
\ No newline at end of file
index d3b889f..5a1147b 100644 (file)
@@ -1,9 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>0</merged>
 <total>0</total>
 <start>0</start>
 <num>0</num>
-</show>
+</show>
\ No newline at end of file
index f079915..2bfdae4 100644 (file)
@@ -23,4 +23,4 @@
 <md-test-usersetting>XXXXXXXXXX</md-test-usersetting>
 <md-test-usersetting-2>test-usersetting-2 data: 
         YYYYYYYYY</md-test-usersetting-2></location>
-</record>
+</record>
\ No newline at end of file
index f6ca445..ec2e70b 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>1</merged>
 <total>1</total>
@@ -23,4 +22,4 @@
 <relevance>320000</relevance>
 <recid>title the religious teachers of greece author adam james medium book</recid>
 </hit>
-</show>
+</show>
\ No newline at end of file
index 43fcf8b..adc14ce 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>1</merged>
 <total>1</total>
@@ -23,4 +22,4 @@
 <relevance>120000</relevance>
 <recid>title the religious teachers of greece author adam james medium book</recid>
 </hit>
-</show>
+</show>
\ No newline at end of file
index 84feb43..65b37e4 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>9</merged>
 <total>10</total>
         YYYYYYYYY</md-test-usersetting-2></location>
 <recid>title the computer bible author medium book</recid>
 </hit>
-</show>
+</show>
\ No newline at end of file
index 407ac56..b3a3f53 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>9</merged>
 <total>10</total>
         YYYYYYYYY</md-test-usersetting-2></location>
 <recid>title washington metropolitan area rail computer feasibility study author englund carl r medium book</recid>
 </hit>
-</show>
+</show>
\ No newline at end of file
index 00a481a..bf54b7a 100644 (file)
@@ -1,5 +1,5 @@
-<termlist>
-<activeclients>0</activeclients>
+<?xml version="1.0" encoding="UTF-8"?>
+<termlist><activeclients>0</activeclients>
 <list name="xtargets">
 <term>
 <id>z3950.indexdata.com/marc</id>
@@ -9,4 +9,4 @@
 <diagnostic>0</diagnostic>
 </term>
 </list>
-</termlist>
+</termlist>
\ No newline at end of file
index 84feb43..65b37e4 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>9</merged>
 <total>10</total>
         YYYYYYYYY</md-test-usersetting-2></location>
 <recid>title the computer bible author medium book</recid>
 </hit>
-</show>
+</show>
\ No newline at end of file
index 407ac56..b3a3f53 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>9</merged>
 <total>10</total>
         YYYYYYYYY</md-test-usersetting-2></location>
 <recid>title washington metropolitan area rail computer feasibility study author englund carl r medium book</recid>
 </hit>
-</show>
+</show>
\ No newline at end of file
index 90fd4e3..50f1703 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>9</merged>
 <total>10</total>
 <count>2</count>
 <recid>title how to program a computer author jack collins medium book</recid>
 </hit>
-</show>
+</show>
\ No newline at end of file
index 703dcfe..863b4ea 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>9</merged>
 <total>10</total>
 <count>2</count>
 <recid>title how to program a computer author jack collins medium book</recid>
 </hit>
-</show>
+</show>
\ No newline at end of file
index b816997..80dde63 100644 (file)
@@ -1,5 +1,5 @@
-<termlist>
-<activeclients>0</activeclients>
+<?xml version="1.0" encoding="UTF-8"?>
+<termlist><activeclients>0</activeclients>
 <list name="author">
 <term><name>Jack Collins</name><frequency>2</frequency></term>
 <term><name>Englund, Carl R.</name><frequency>1</frequency></term>
@@ -18,4 +18,4 @@
 <term><name>Tomography</name><frequency>1</frequency></term>
 <term><name>Universities And Colleges</name><frequency>1</frequency></term>
 </list>
-</termlist>
+</termlist>
\ No newline at end of file
index f09bc0a..6578cb1 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>9</merged>
 <total>10</total>
 <relevance>0</relevance>
 <recid>title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book</recid>
 </hit>
-</show>
+</show>
\ No newline at end of file
index 4ad81c0..25fe7de 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>9</merged>
 <total>10</total>
 <relevance>0</relevance>
 <recid>title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book</recid>
 </hit>
-</show>
+</show>
\ No newline at end of file
index 4ad81c0..25fe7de 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>9</merged>
 <total>10</total>
 <relevance>0</relevance>
 <recid>title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book</recid>
 </hit>
-</show>
+</show>
\ No newline at end of file
index e28d1a8..70974e0 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>3</merged>
 <total>3</total>
@@ -27,4 +26,4 @@
 <relevance>0</relevance>
 <recid>title oil gas drilling author medium book</recid>
 </hit>
-</show>
+</show>
\ No newline at end of file
index 406581f..f9018d9 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>97</merged>
 <total>1995</total>
 <relevance>12121</relevance>
 <recid>title mercados e instituciones de aguas en bolivia medium book</recid>
 </hit>
-</show>
+</show>
\ No newline at end of file
index dd89fec..9d5251c 100644 (file)
@@ -1,5 +1,5 @@
-<termlist>
-<activeclients>0</activeclients>
+<?xml version="1.0" encoding="UTF-8"?>
+<termlist><activeclients>0</activeclients>
 <list name="xtargets">
 <term>
 <id>ocs-test.indexdata.com/solr/select</id>
@@ -64,4 +64,4 @@
 <term><name>book</name><frequency>99</frequency></term>
 <term><name>book (electronic)</name><frequency>1</frequency></term>
 </list>
-</termlist>
+</termlist>
\ No newline at end of file
index 3ed2d80..2baf08e 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>3</merged>
 <total>3</total>
@@ -58,4 +57,4 @@ operator, driller, location, depth, copies of logs run, permits, samples
 <relevance>0</relevance>
 <recid>title oil gas drilling author medium book</recid>
 </hit>
-</show>
+</show>
\ No newline at end of file
index 5c85987..20c400e 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<show>
-<status>OK</status>
+<show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>3</merged>
 <total>3</total>
@@ -33,4 +32,4 @@
 <relevance>0</relevance>
 <recid>title oil gas drilling</recid>
 </hit>
-</show>
+</show>
\ No newline at end of file