def _load_citation(loader: _Loader, element: ElementTree.Element) -> None: handle = element.get('handle') source_handle = _xpath1(element, './ns:sourceref').get('hlink') citation = IdentifiableCitation(element.get('id'), loader._sources[source_handle]) citation.date = _load_date(element) _load_objref(loader, citation, element) _load_attribute_privacy(citation, element, 'srcattribute') page = _xpath1(element, './ns:page') if page is not None: citation.location = page.text loader._citations[handle] = citation
def _parse_citation(ancestry: _IntermediateAncestry, element: Element) -> None: handle = _xpath1(element, './@handle') source_handle = _xpath1(element, './ns:sourceref/@hlink') citation = IdentifiableCitation(_xpath1(element, './@id'), ancestry.sources[source_handle]) citation.date = _parse_date(element) _parse_objref(ancestry, citation, element) _parse_attribute_privacy(citation, element, 'srcattribute') page = _xpath1(element, './ns:page') if page is not None: citation.location = page.text ancestry.citations[handle] = citation