var m100c = '';
var m245a = '';
var m245b = '';
+ var m245p = '';
var xmlDoc = new DOMParser().parseFromString(marcxml, 'text/xml');
var tag = node.getAttribute('tag');
if (tag == '100') {
dojo.forEach(node.childNodes, function(sub_node) {
- var code = sub_node.getAttribute('code');
- if (code == 'a') m100a = sub_node.textContent;
- if (code == 'c') m100c = sub_node.textContent;
+ if (sub_node.nodeType == Node.ELEMENT_NODE) {
+ var code = sub_node.getAttribute('code');
+ if (code == 'a') m100a = sub_node.textContent;
+ if (code == 'c') m100c = sub_node.textContent;
+ }
});
} else if (tag == '245') {
dojo.forEach(node.childNodes, function(sub_node) {
- var code = sub_node.getAttribute('code');
- if (code == 'a') m245a = sub_node.textContent;
- if (code == 'b') m245b = sub_node.textContent;
+ if (sub_node.nodeType == Node.ELEMENT_NODE) {
+ var code = sub_node.getAttribute('code');
+ if (code == 'a') m245a = sub_node.textContent;
+ if (code == 'b') m245b = sub_node.textContent;
+ if (code == 'p') m245p = sub_node.textContent;
+ }
});
}
}
return {
author : m100a + ' ' + m100c,
- title : m245a + ' ' + m245b
+ title : m245a + ' ' + m245b + ' ' + m245p
};
}