def addLinkbaseRef(lbType, lbFilename, lbDoc):
    role = 'http://www.xbrl.org/2003/role/{0}LinkbaseRef'.format(lbType)
    lbRefElt = XmlUtil.addChild(appinfoElt, XbrlConst.link, 'linkbaseRef', attributes=((('{http://www.w3.org/1999/xlink}type', 'simple'), ('{http://www.w3.org/1999/xlink}href', docRelpath(lbFilename, thisDoc.extensionSchemaRelDirname)), ('{http://www.w3.org/1999/xlink}arcrole', 'http://www.w3.org/1999/xlink/properties/linkbase')) + (() if lbType.startswith('generic') else (('{http://www.w3.org/1999/xlink}role', role),))))
    if lbDoc:
        doc.referencesDocument[lbDoc] = ModelDocumentReference('href', lbRefElt)
def addLinkbaseRef(lbType, lbFilename, lbDoc):
    role = 'http://www.xbrl.org/2003/role/{0}LinkbaseRef'.format(lbType)
    lbRefElt = XmlUtil.addChild(appinfoElt, XbrlConst.link, 'linkbaseRef', attributes=((('{http://www.w3.org/1999/xlink}type', 'simple'), ('{http://www.w3.org/1999/xlink}href', docRelpath(lbFilename, thisDoc.extensionSchemaRelDirname)), ('{http://www.w3.org/1999/xlink}arcrole', 'http://www.w3.org/1999/xlink/properties/linkbase')) + (() if lbType.startswith('generic') else (('{http://www.w3.org/1999/xlink}role', role),))))
    if lbDoc:
        doc.referencesDocument[lbDoc] = ModelDocumentReference('href', lbRefElt)