def _get_reference(self, ref):
label = get_value_in_tag(ref, '<STR_LIT:label>')<EOL>label = re.sub('<STR_LIT>', '<STR_LIT>', label)<EOL>for innerref in ref.getElementsByTagName('<STR_LIT>'):<EOL><INDENT>ref_type = innerref.getAttribute('<STR_LIT>')<EOL>institution = get_value_in_tag(innerref, '<STR_LIT>')<EOL>report_no = '<STR_LIT>'<EOL>for tag in innerref.getElementsByTagName('<STR_LIT>'):<EOL><INDENT>if tag.getAttribute('<STR_LIT>') == '<STR_LIT>':<EOL><INDENT>if tag.hasChildNodes():<EOL><INDENT>report_no = get_all_text(tag)<EOL><DEDENT><DEDENT><DEDENT>doi = '<STR_LIT>'<EOL>for tag in innerref.getElementsByTagName('<STR_LIT>'):<EOL><INDENT>if tag.getAttribute('<STR_LIT>') == '<STR_LIT>':<EOL><INDENT>doi = xml_to_text(tag)<EOL><DEDENT><DEDENT>collaboration = get_value_in_tag(innerref, '<STR_LIT>')<EOL>authors = []<EOL>person_groups = innerref.getElementsByTagName('<STR_LIT>')<EOL>for author_group in person_groups:<EOL><INDENT>if author_group.getAttribute('<STR_LIT>') == '<STR_LIT>':<EOL><INDENT>for author in author_group.getElementsByTagName('<STR_LIT>'):<EOL><INDENT>if author.hasChildNodes():<EOL><INDENT>authors.append(get_all_text(author))<EOL><DEDENT><DEDENT><DEDENT><DEDENT>editors = []<EOL>for editor_group in person_groups:<EOL><INDENT>if editor_group.getAttribute('<STR_LIT>') == '<STR_LIT>':<EOL><INDENT>for editor in editor_group.getElementsByTagName('<STR_LIT>'):<EOL><INDENT>if editor.hasChildNodes():<EOL><INDENT>editors.append(get_all_text(editor))<EOL><DEDENT><DEDENT><DEDENT><DEDENT>journal = get_value_in_tag(innerref, '<STR_LIT:source>')<EOL>journal, volume = fix_journal_name(journal, self.journal_mappings)<EOL>volume += get_value_in_tag(innerref, '<STR_LIT>')<EOL>if journal == '<STR_LIT>' or journal == '<STR_LIT>':<EOL><INDENT>issue = get_value_in_tag(innerref, '<STR_LIT>')<EOL>volume = volume[<NUM_LIT:2>:] + issue<EOL>journal = '<STR_LIT>'<EOL><DEDENT>page = get_value_in_tag(innerref, '<STR_LIT>')<EOL>year = get_value_in_tag(innerref, '<STR_LIT>')<EOL>external_link = get_value_in_tag(innerref, '<STR_LIT>')<EOL>arxiv = '<STR_LIT>'<EOL>for tag in innerref.getElementsByTagName('<STR_LIT>'):<EOL><INDENT>if tag.getAttribute('<STR_LIT>') == '<STR_LIT>':<EOL><INDENT>if tag.hasChildNodes():<EOL><INDENT>arxiv = get_all_text(tag)<EOL><DEDENT><DEDENT><DEDENT>arxiv = format_arxiv_id(arxiv)<EOL>publisher = get_value_in_tag(innerref, '<STR_LIT>')<EOL>publisher_location = get_value_in_tag(innerref, '<STR_LIT>')<EOL>if publisher_location:<EOL><INDENT>publisher = publisher_location + '<STR_LIT>' + publisher<EOL><DEDENT>unstructured_text = []<EOL>for child in innerref.childNodes:<EOL><INDENT>if child.nodeType == child.TEXT_NODE:<EOL><INDENT>text = child.nodeValue.strip()<EOL>text = re.sub(r'<STR_LIT>', '<STR_LIT>', text).strip()<EOL>if text.startswith('<STR_LIT:U+002C>'):<EOL><INDENT>text = text[<NUM_LIT:1>:].strip()<EOL><DEDENT>if text.endswith('<STR_LIT>'):<EOL><INDENT>text = institution + "<STR_LIT:U+0020>" + text<EOL>institution = '<STR_LIT>'<EOL>text = text.strip()<EOL><DEDENT>elif text.endswith('<STR_LIT>'):<EOL><INDENT>text += '<STR_LIT:.>'<EOL><DEDENT>elif text.endswith('<STR_LIT>'):<EOL><INDENT>if institution:<EOL><INDENT>text += '<STR_LIT:U+0020>' + institution<EOL>institution = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>text = text[:-<NUM_LIT:1>]<EOL><DEDENT><DEDENT>elif text.startswith('<STR_LIT>'):<EOL><INDENT>article_title = get_value_in_tag(innerref, '<STR_LIT>')<EOL>text = institution + "<STR_LIT>" + article_title + "<STR_LIT>"<EOL>institution = '<STR_LIT>'<EOL><DEDENT>elif text == u'<STR_LIT>':<EOL><INDENT>text = '<STR_LIT>'<EOL><DEDENT>ignore_text = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL>if text.startswith('<STR_LIT>'):<EOL><INDENT>temp = re.sub(r'<STR_LIT>', '<STR_LIT>', text)<EOL>if temp:<EOL><INDENT>volume += temp<EOL><DEDENT><DEDENT>elif len(text) > <NUM_LIT:1> and text not in ignore_textand not (text.isdigit() or text[:-<NUM_LIT:1>].isdigit()):<EOL><INDENT>unstructured_text.append(text)<EOL><DEDENT><DEDENT><DEDENT>if unstructured_text:<EOL><INDENT>unstructured_text = "<STR_LIT:U+0020>".join(unstructured_text)<EOL><DEDENT>if ref_type == '<STR_LIT>':<EOL><INDENT>if volume and not volume.lower().startswith('<STR_LIT>'):<EOL><INDENT>volume = '<STR_LIT>' + volume<EOL><DEDENT>if volume and page:<EOL><INDENT>volume = volume + '<STR_LIT>' + page<EOL><DEDENT><DEDENT>yield ref_type, doi, authors, collaboration, journal, volume, page, year,label, arxiv, publisher, institution, unstructured_text, external_link,report_no, editors<EOL><DEDENT>
Retrieve the data for a reference.