#NEWLINE# def builtin( self , ref , context = None ) : #NEWLINE# #INDENT# '\n        Get whether the specified reference is an (xs) builtin.\n        @param ref: A str or qref.\n        @type ref: (str|qref)\n        @return: True if builtin, else False.\n        @rtype: bool\n        ' #NEWLINE# w3 = 'http://www.w3.org' #NEWLINE# try : #NEWLINE# #INDENT# if isqref ( ref ) : #NEWLINE# #INDENT# ns = ref [ 1 ] #NEWLINE# return ( ( ref [ 0 ] in Factory . tags ) and ns . startswith ( w3 ) ) #NEWLINE# #UNINDENT# if ( ns is None ) : #NEWLINE# #INDENT# context = self . root #NEWLINE# #UNINDENT# prefix = splitPrefix ( ref ) [ 0 ] #NEWLINE# prefixes = context . findPrefixes ( w3 , 'startswith' ) #NEWLINE# return ( ( prefix in prefixes ) and ( ref [ 0 ] in Factory . tags ) ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# return False