#include <yaz/nmem.h>
-#include <marcmap.h>
-#include <marchash.h>
+#include "marcmap.h"
+#include "marchash.h"
-struct marcmap *marcmap_load(char *filename, NMEM nmem) {
+struct marcmap *marcmap_load(const char *filename, NMEM nmem)
+{
struct marcmap *mm;
struct marcmap *mmhead;
FILE *fp;
struct marcmap *mmcur;
xml_out = xmlNewDoc(BAD_CAST "1.0");
+ xml_out->encoding = xmlCharStrdup("UTF-8");
xml_out_root = xmlNewNode(NULL, BAD_CAST "record");
xmlDocSetRootElement(xml_out, xml_out_root);
ns_pz = xmlNewNs(xml_out_root, BAD_CAST "http://www.indexdata.com/pazpar2/1.0", BAD_CAST "pz");
+ xmlSetNs(xml_out_root, ns_pz);
nmem = nmem_create();
rec_node = xmlDocGetRootElement(xml_in);
marchash = marchash_create(nmem);
if ((field = marchash_get_field(marchash, "245", NULL)) && (subfield = marchash_get_subfield('a', field, NULL)))
strncat(mergekey, subfield->val, 1023 - strlen(mergekey));
strncat(mergekey, " author ", 1023 - strlen(mergekey));
- if ((field = marchash_get_field(marchash, "245", NULL)) && (subfield = marchash_get_subfield('a', field, NULL)))
+ if ((field = marchash_get_field(marchash, "100", NULL)) && (subfield = marchash_get_subfield('a', field, NULL)))
strncat(mergekey, subfield->val, 1023 - strlen(mergekey));
strncat(mergekey, " medium ", 1023 - strlen(mergekey));
strncat(mergekey, medium, 1023 - strlen(mergekey));
- xmlSetProp(xml_out_root, BAD_CAST "mergekey", BAD_CAST mergekey);
+// xmlSetProp(xml_out_root, BAD_CAST "mergekey", BAD_CAST mergekey);
nmem_destroy(nmem);
return xml_out;