#NEWLINE# def apply( self , root ) : #NEWLINE# #INDENT# '\n        Apply the import (rule) to the specified schema.\n        If the schema does not already contain an import for the\n        I{namespace} specified here, it is added.\n        @param root: A schema root.\n        @type root: L{Element}\n        ' #NEWLINE# if ( not self . filter . match ( root , self . ns ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if self . exists ( root ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# node = Element ( 'import' , ns = self . xsdns ) #NEWLINE# node . set ( 'namespace' , self . ns ) #NEWLINE# if ( self . location is not None ) : #NEWLINE# #INDENT# node . set ( 'schemaLocation' , self . location ) #NEWLINE# #UNINDENT# root . insert ( node )