+ match_v_next(&ptr, "availableNow", nmem, &(*circp)->availableNow);
+ /* note the spelling of the ASN.1 member below */
+ match_element_next(&ptr, "availabilityDate", nmem,
+ &(*circp)->availablityDate);
+ match_element_next(&ptr, "availableThru", nmem, &(*circp)->availableThru);
+ match_element_next(&ptr, "restrictions", nmem, &(*circp)->restrictions);
+ match_element_next(&ptr, "itemId", nmem, &(*circp)->itemId);
+ match_v_next(&ptr, "renewable", nmem, &(*circp)->renewable);
+ match_v_next(&ptr, "onHold", nmem, &(*circp)->onHold);
+ match_element_next(&ptr, "enumAndChron", nmem, &(*circp)->enumAndChron);
+ match_element_next(&ptr, "midspine", nmem, &(*circp)->midspine);
+ match_element_next(&ptr, "temporaryLocation", nmem,
+ &(*circp)->temporaryLocation);
+ return 1;
+}
+
+static int circulations(xmlNode *ptr, Z_CircRecord ***circp,
+ int *num, NMEM nmem)
+{
+ int i;
+ xmlNode *ptr0 = ptr;
+
+ for (i = 0; ptr; i++)
+ {
+ while (ptr && ptr->type != XML_ELEMENT_NODE)
+ ptr = ptr->next;
+ if (!ptr)
+ break;
+ if (!match_element(ptr, "circulation"))
+ return 0;
+ ptr = ptr->next;
+ }
+ *num = i;
+ *circp = (Z_CircRecord **) nmem_malloc(nmem, sizeof(**circp) * i);
+ ptr = ptr0;
+ for (i = 0; ptr; i++)
+ {
+ while (ptr && ptr->type != XML_ELEMENT_NODE)
+ ptr = ptr->next;
+ if (!ptr)
+ break;
+ if (!match_element(ptr, "circulation"))
+ return 0;
+ circulation(ptr->children, (*circp) + i, nmem);
+ ptr = ptr->next;
+ }
+ return 1;