'Set up the prefix mapping, which maps fully qualified namespace URIs
onto namespace prefixes.
This gets called before startElementNS whenever an C{xmlns} attribute
is seen.'

def startPrefixMapping(self, prefix, uri):

    self.prefixMap = _NSContext(self.prefixMap)
    self.prefixMap[uri] = prefix
    if (uri == TEMPLATE_NAMESPACE):
        return
    if (prefix is None):
        self.xmlnsAttrs.append(('xmlns', uri))
    else:
        self.xmlnsAttrs.append((('xmlns:%s' % prefix), uri))
