'Find the XSLT stylesheet for this request
@param method: "import" for data imports, else None
@param skip_error: do not raise an HTTP error status
if the stylesheet cannot be found'

def stylesheet(self, method=None, skip_error=False):

    stylesheet = None
    format = self.representation
    if self.component:
        resourcename = self.component.name
    else:
        resourcename = self.name
    if (format == 'xml'):
        return stylesheet
    if ('transform' in self.vars):
        return self.vars['transform']
    extension = self.XSLT_EXTENSION
    filename = ('%s.%s' % (resourcename, extension))
    if (filename in self.post_vars):
        p = self.post_vars[filename]
        import cgi
        if (isinstance(p, cgi.FieldStorage) and p.filename):
            stylesheet = p.file
        return stylesheet
    folder = self.folder
    path = self.XSLT_PATH
    if (method != 'import'):
        method = 'export'
    filename = ('%s.%s' % (method, extension))
    stylesheet = os.path.join(folder, path, format, filename)
    if (not os.path.exists(stylesheet)):
        if (not skip_error):
            self.error(501, ('%s:    %s' % (current.ERROR.BAD_TEMPLATE, stylesheet)))
        else:
            stylesheet = None
    return stylesheet
