def get_record(self, fileName, ref_extract_callback=None):
self.document = parse(fileName)<EOL>article_type = self._get_article_type()<EOL>if article_type not in ['<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>']:<EOL><INDENT>return '<STR_LIT>'<EOL><DEDENT>rec = create_record()<EOL>title, subtitle, notes = self._get_title()<EOL>subfields = []<EOL>if subtitle:<EOL><INDENT>subfields.append(('<STR_LIT:b>', subtitle))<EOL><DEDENT>if title:<EOL><INDENT>subfields.append(('<STR_LIT:a>', title))<EOL>record_add_field(rec, '<STR_LIT>', subfields=subfields)<EOL><DEDENT>subjects = self.document.getElementsByTagName('<STR_LIT>')<EOL>subjects = map(xml_to_text, subjects)<EOL>for note_id in notes:<EOL><INDENT>note = self._get_note(note_id)<EOL>if note:<EOL><INDENT>record_add_field(rec, '<STR_LIT>', subfields=[('<STR_LIT:a>', note)])<EOL><DEDENT><DEDENT>for subject in subjects:<EOL><INDENT>record_add_field(rec, '<STR_LIT>', ind1='<STR_LIT:1>', ind2='<STR_LIT>',<EOL>subfields=[('<STR_LIT:2>', '<STR_LIT>'),<EOL>('<STR_LIT:a>', subject)])<EOL><DEDENT>keywords = self._get_keywords()<EOL>for keyword in keywords:<EOL><INDENT>record_add_field(rec, '<STR_LIT>', ind1='<STR_LIT:1>', subfields=[('<STR_LIT:a>', keyword),<EOL>('<STR_LIT>', '<STR_LIT>')])<EOL><DEDENT>journal, volume, issue, year, date, doi, page,fpage, lpage = self._get_publication_information()<EOL>astronomy_journals = ['<STR_LIT>', '<STR_LIT>']<EOL>if journal in astronomy_journals:<EOL><INDENT>record_add_field(rec, '<STR_LIT>', ind1='<STR_LIT:1>', ind2='<STR_LIT>',<EOL>subfields=[('<STR_LIT:2>', '<STR_LIT>'),<EOL>('<STR_LIT:a>', '<STR_LIT>')])<EOL><DEDENT>if date:<EOL><INDENT>record_add_field(rec, '<STR_LIT>', subfields=[('<STR_LIT:c>', date),<EOL>('<STR_LIT:t>', '<STR_LIT>')])<EOL><DEDENT>if doi:<EOL><INDENT>record_add_field(rec, '<STR_LIT>', ind1='<STR_LIT>', subfields=[('<STR_LIT:a>', doi),<EOL>('<STR_LIT:2>', '<STR_LIT>')])<EOL><DEDENT>abstract = self._get_abstract()<EOL>abstract = self._format_abstract(abstract)<EOL>if abstract:<EOL><INDENT>record_add_field(rec, '<STR_LIT>', subfields=[('<STR_LIT:a>', abstract),<EOL>('<STR_LIT>', '<STR_LIT>')])<EOL><DEDENT>license, license_type, license_url = self._get_license()<EOL>subfields = []<EOL>if license:<EOL><INDENT>subfields.append(('<STR_LIT:a>', license))<EOL><DEDENT>if license_url:<EOL><INDENT>subfields.append(('<STR_LIT:u>', license_url))<EOL><DEDENT>if subfields:<EOL><INDENT>record_add_field(rec, '<STR_LIT>', subfields=subfields)<EOL><DEDENT>if license_type == '<STR_LIT>':<EOL><INDENT>self._attach_fulltext(rec, doi)<EOL><DEDENT>number_of_pages = self._get_page_count()<EOL>if number_of_pages:<EOL><INDENT>record_add_field(rec, '<STR_LIT>', subfields=[('<STR_LIT:a>', number_of_pages)])<EOL><DEDENT>c_holder, c_year, c_statement = self._get_copyright()<EOL>if c_holder and c_year:<EOL><INDENT>record_add_field(rec, '<STR_LIT>', subfields=[('<STR_LIT:d>', c_holder),<EOL>('<STR_LIT:g>', c_year),<EOL>('<STR_LIT:e>', '<STR_LIT>')])<EOL><DEDENT>elif c_statement:<EOL><INDENT>record_add_field(rec, '<STR_LIT>', subfields=[('<STR_LIT:f>', c_statement),<EOL>('<STR_LIT:e>', '<STR_LIT>')])<EOL><DEDENT>subfields = []<EOL>if journal:<EOL><INDENT>subfields.append(('<STR_LIT:p>', journal))<EOL><DEDENT>if issue:<EOL><INDENT>subfields.append(('<STR_LIT:n>', issue))<EOL><DEDENT>if volume:<EOL><INDENT>subfields.append(('<STR_LIT:v>', volume))<EOL><DEDENT>if fpage and lpage:<EOL><INDENT>subfields.append(('<STR_LIT:c>', '<STR_LIT>' % (fpage,<EOL>lpage)))<EOL><DEDENT>elif page:<EOL><INDENT>subfields.append(('<STR_LIT:c>', page))<EOL><DEDENT>if year:<EOL><INDENT>subfields.append(('<STR_LIT:y>', year))<EOL><DEDENT>record_add_field(rec, '<STR_LIT>', subfields=subfields)<EOL>record_add_field(rec, '<STR_LIT>', subfields=[('<STR_LIT:a>', '<STR_LIT>')])<EOL>conference = '<STR_LIT>'<EOL>for tag in self.document.getElementsByTagName('<STR_LIT>'):<EOL><INDENT>conference = xml_to_text(tag)<EOL><DEDENT>if conference:<EOL><INDENT>record_add_field(rec, '<STR_LIT>', subfields=[('<STR_LIT:a>', '<STR_LIT>')])<EOL>record_add_field(rec, '<STR_LIT>', subfields=[('<STR_LIT:a>', conference)])<EOL><DEDENT>self._add_references(rec, ref_extract_callback)<EOL>self._add_authors(rec)<EOL>try:<EOL><INDENT>return record_xml_output(rec)<EOL><DEDENT>except UnicodeDecodeError:<EOL><INDENT>message = "<STR_LIT>" + doi<EOL>sys.stderr.write(message)<EOL>return "<STR_LIT>"<EOL><DEDENT>
Gets the Marc xml of the files in xaml_jp directory

:param fileName: the name of the file to parse.
:type fileName: string
:param refextract_callback: callback to be used to extract
                            unstructured references. It should
                            return a marcxml formated string
                            of the reference.
:type refextract_callback: callable

:returns: a string with the marc xml version of the file.