if (null != elemName && null != ns)
if (null != elemName)
  public void execute(          TransformerImpl transformer, Node sourceNode, QName mode)            throws TransformerException  {    try    {      ResultTreeHandler rhandler = transformer.getResultTreeHandler();      XPathContext xctxt = transformer.getXPathContext();      String elemName = m_name_avt.evaluate(xctxt, sourceNode, this);      // make sure that if a prefix is specified on the attribute name, it is valid      int indexOfNSSep = elemName.indexOf(':');      String ns = "";      if (indexOfNSSep >= 0)      {        String nsprefix = elemName.substring(0, indexOfNSSep);        // Catch the exception this may cause. We don't want to stop processing.        try        {          ns = getNamespaceForPrefix(nsprefix);          // Check if valid QName. Assuming that if the prefix is defined,          // it is valid.          if (indexOfNSSep + 1 == elemName.length()              ||!isValidNCName(elemName.substring(indexOfNSSep + 1)))          {            transformer.getMsgMgr().warn(                                         XSLTErrorResources.WG_ILLEGAL_ATTRIBUTE_NAME,                                         new Object[]{ elemName });            elemName = null;          }        }        catch (Exception ex)        {          // Could not resolve prefix          ns = null;          transformer.getMsgMgr().warn(                                       XSLTErrorResources.WG_COULD_NOT_RESOLVE_PREFIX,                                       new Object[]{ nsprefix });        }      }      // Check if valid QName      else if (elemName.length() == 0 ||!isValidNCName(elemName))      {        transformer.getMsgMgr().warn(                                     XSLTErrorResources.WG_ILLEGAL_ATTRIBUTE_NAME,                                     new Object[]{ elemName });        elemName = null;      }      // Only do this if name is valid      String elemNameSpace = "";      String prefix = null;      if (null != elemName && null != ns)      {        if (null != m_namespace_avt)        {          elemNameSpace = m_namespace_avt.evaluate(xctxt, sourceNode, this);          if (null != elemNameSpace && elemNameSpace.length() > 0)          {            // Get the prefix for that attribute in the result namespace.            prefix = rhandler.getPrefix(elemNameSpace);            // If we didn't find the prefix mapping, make up a prefix             // and have it declared in the result tree.            if (null == prefix)            {              prefix = rhandler.getNewUniqueNSPrefix();            }            // add the prefix to the attribute name.            if(prefix.length() > 0)              elemName = (prefix + ":" + QName.getLocalPart(elemName));          }        }        // Add namespace declarations.        executeNSDecls(transformer);        if (null != prefix)        {          rhandler.startPrefixMapping(prefix, elemNameSpace, true);        }        rhandler.startElement(elemNameSpace, QName.getLocalPart(elemName),                              elemName);      }      // Instantiate content of xsl:element. Note that if startElement was not      // called(ie: if invalid element name, the element's attributes will be      // excluded because transformer.m_pendingElementName will be null.      super.execute(transformer, sourceNode, mode);      transformer.executeChildTemplates(this, sourceNode, mode);      // Now end the element if name was valid      if (null != elemName && null != ns)      {        rhandler.endElement("", "", elemName);        unexecuteNSDecls(transformer);      }    }    catch(SAXException se)    {      throw new TransformerException(se);    }  }