record conv: select return org record if no x-path match YAZ-814
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 13 Jan 2015 13:12:19 +0000 (14:12 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 13 Jan 2015 13:12:19 +0000 (14:12 +0100)
src/record_conv.c

index 2fbe986..a74b4c5 100644 (file)
@@ -378,10 +378,11 @@ static int convert_select(void *vinfo, WRBUF record, WRBUF wr_error)
             if (xpathObj)
             {
                 xmlNodeSetPtr nodes = xpathObj->nodesetval;
-                wrbuf_rewind(record);
                 if (nodes)
                 {
                     int i;
+                    if (nodes->nodeNr > 0)
+                        wrbuf_rewind(record);
                     for (i = 0; i < nodes->nodeNr; i++)
                     {
                         xmlNode *ptr = nodes->nodeTab[i];