def extract_unii_name(tree): unii_name_xpath = '//identifiedSubstance/name/descendant::text()' return extract.first_match_or_empty_string( tree.getroot().xpath(unii_name_xpath))
def extract_unii(tree): unii_xpath = '//id[@root="%s"]/@extension' % UNII_OID return extract.first_match_or_empty_string( tree.getroot().xpath(unii_xpath))
def extract_set_id(tree): return extract.first_match_or_empty_string( tree.getroot().xpath('/document/setId/@root'))
def extract_unii(tree): unii_xpath = '//id[@root="%s"]/@extension' % UNII_OID return extract.first_match_or_empty_string(tree.getroot().xpath(unii_xpath))