def parse_relationship(document, xmlcontent, rel_type):
    """Parse relationship document.

    Relationships hold information like external or internal references for links.

    Relationships are placed in file '_rels/document.xml.rels'.
    """

    doc = etree.fromstring(xmlcontent)

    for elem in doc:
        if elem.tag == _name('{{{pr}}}Relationship'):
            rel = {'target': elem.attrib['Target'],
                   'type': elem.attrib['Type'],
                   'target_mode': elem.attrib.get('TargetMode', 'Internal')}

            document.relationships[rel_type][elem.attrib['Id']] = rel
def parse_relationship ( document , xmlcontent , rel_type ) : doc = etree . fromstring ( xmlcontent ) for elem in doc : if elem . tag == _name ( '{{{pr}}}Relationship' ) : rel = { 'target' : elem . attrib [ 'Target' ] , 'type' : elem . attrib [ 'Type' ] , 'target_mode' : elem . attrib . get ( 'TargetMode' , 'Internal' ) } document . relationships [ rel_type ] [ elem . attrib [ 'Id' ] ] = rel
Parse relationship document.

    Relationships hold information like external or internal references for links.

    Relationships are placed in file '_rels/document.xml.rels'.