def axml_context(d):
xml = etree.Element("<STR_LIT>", nsmap=ns)<EOL>etree.SubElement(xml, "<STR_LIT:id>").text = d['<STR_LIT:id>']<EOL>spec_reference = [axml_link(do) for do in<EOL>extract_p('<STR_LIT>', d, [])]<EOL>[xml.append(el) for el in spec_reference if el is not None]<EOL>area_of_interest = extract_p('<STR_LIT>', d, None)<EOL>if area_of_interest is not None:<EOL><INDENT>try:<EOL><INDENT>gml = etree.fromstring(area_of_interest)<EOL>georss = etree.SubElement(xml, ns_elem("<STR_LIT>", "<STR_LIT>"))<EOL>georss.append(gml)<EOL><DEDENT>except Exception as ex:<EOL><INDENT>log.warn('<STR_LIT>', ex)<EOL>pass<EOL><DEDENT><DEDENT>context_metadata = [axml_link(do) for do in<EOL>extract_p('<STR_LIT>', d, [])]<EOL>[xml.append(el) for el in context_metadata if el is not None]<EOL>language = extract_p('<STR_LIT>', d, None)<EOL>if language is not None: xml.set(ns_elem("<STR_LIT>", "<STR_LIT>"), language)<EOL>title = extract_p('<STR_LIT>', d, None)<EOL>if title is not None: etree.SubElement(xml, "<STR_LIT:title>").text = title<EOL>subtitle = extract_p('<STR_LIT>', d, None)<EOL>if subtitle is not None: etree.SubElement(xml, "<STR_LIT>").text = subtitle<EOL>update_date = extract_p('<STR_LIT>', d, None)<EOL>if update_date is not None: etree.SubElement(xml, "<STR_LIT>").text = update_date<EOL>authors = [axml_author(do) for do in extract_p('<STR_LIT>', d, [])]<EOL>[xml.append(el) for el in authors if el is not None]<EOL>publisher = extract_p('<STR_LIT>', d, None)<EOL>if publisher is not None: etree.SubElement(xml, ns_elem("<STR_LIT>", "<STR_LIT>")).text = publisher<EOL>creator_application = axml_creator_app(extract_p('<STR_LIT>', d, None))<EOL>if creator_application is not None and not is_empty(creator_application): xml.append(creator_application)<EOL>creator_display = axml_display(extract_p('<STR_LIT>', d, None))<EOL>if creator_display is not None: xml.append(creator_display)<EOL>rights = extract_p('<STR_LIT>', d, None)<EOL>if rights is not None: etree.SubElement(xml, "<STR_LIT>").text = rights<EOL>time_interval_of_interest = extract_p('<STR_LIT>', d, None)<EOL>if time_interval_of_interest is not None: etree.SubElement(xml,<EOL>ns_elem("<STR_LIT>", "<STR_LIT:date>")).text = time_interval_of_interest<EOL>keywords = [axml_category(do) for do in<EOL>extract_p('<STR_LIT>', d, [])]<EOL>[xml.append(el) for el in keywords if el is not None]<EOL>resources = [axml_resource(do) for do in<EOL>extract_p('<STR_LIT>', d, [])]<EOL>[xml.append(el) for el in resources if el is not None]<EOL>return xml<EOL>
encodes base OwcContext as dict to atom xml tree
:param d:
:return: