if ("xmlns".equals(localName)) {  ; } else if (rawName != null && rawName.startsWith("xmlns:")) {  ; } else {   m_attributes.setValue(index, value); }
m_attributes.setValue(index, value);
    public boolean addAttributeAlways(        String uri,        String localName,        String rawName,        String type,        String value,        boolean xslAttribute)    {        boolean was_added;        int index;        if (uri == null || localName == null || uri.length() == 0)            index = m_attributes.getIndex(rawName);        else {            index = m_attributes.getIndex(uri, localName);        }        if (index >= 0)        {            // Trying to update the value of an existing attribute            String old_value = null;            if (m_tracer != null)            {                old_value = m_attributes.getValue(index);                if (value.equals(old_value))                    old_value = null;            }            /* We've seen the attribute before.             * We may have a null uri or localName, but all we really             * want to re-set is the value anyway.             */            if ("xmlns".equals(localName)) {                // Don't update pseudo-attributes of the form xmlns='uri'                ;            }            else if (rawName != null && rawName.startsWith("xmlns:")) {                // Don't update pseudo-attributes of the form xmlns:prf='uri'                ;            }            else {                // Update normal attributes, which is OK because this could                // be from an xsl:attribute element in the stylesheet.                m_attributes.setValue(index, value);            }                        was_added = false;            if (old_value != null)                firePseudoAttributes();        }        else        {            // the attribute doesn't exist yet, create it            if (xslAttribute)            {                /*                 * This attribute is from an xsl:attribute element so we take some care in                 * adding it, e.g.                 *   <elem1  foo:attr1="1" xmlns:foo="uri1">                 *       <xsl:attribute name="foo:attr2">2</xsl:attribute>                 *   </elem1>                 *                  * We are adding attr1 and attr2 both as attributes of elem1,                 * and this code is adding attr2 (the xsl:attribute ).                 * We could have a collision with the prefix like in the example above.                 */                // In the example above, is there a prefix like foo ?                final int colonIndex = rawName.indexOf(':');                if (colonIndex > 0)                {                    String prefix = rawName.substring(0,colonIndex);                    NamespaceMappings.MappingRecord existing_mapping = m_prefixMap.getMappingFromPrefix(prefix);                    /* Before adding this attribute (foo:attr2),                     * is the prefix for it (foo) already mapped at the current depth?                     */                    if (existing_mapping != null                     && existing_mapping.m_declarationDepth == m_elemContext.m_currentElemDepth                    && !existing_mapping.m_uri.equals(uri))                    {                        /*                         * There is an existing mapping of this prefix,                         * it differs from the one we need,                         * and unfortunately it is at the current depth so we                          * can not over-ride it.                         */                        /*                         * Are we lucky enough that an existing other prefix maps to this URI ?                         */                        prefix = m_prefixMap.lookupPrefix(uri);                        if (prefix == null)                        {                            /* Unfortunately there is no existing prefix that happens to map to ours,                             * so to avoid a prefix collision we must generated a new prefix to use.                              * This is OK because the prefix URI mapping                             * defined in the xsl:attribute is short in scope,                              * just the xsl:attribute element itself,                              * and at this point in serialization the body of the                             * xsl:attribute, if any, is just a String. Right?                             *   . . . I sure hope so - Brian M.                              */                            prefix = m_prefixMap.generateNextPrefix();                        }                        rawName = prefix + ':' + localName;                    }                }                try                {                    /* This is our last chance to make sure the namespace for this                     * attribute is declared, especially if we just generated an alternate                     * prefix to avoid a collision (the new prefix/rawName will go out of scope                     * soon and be lost ...  last chance here.                     */                    String prefixUsed =                        ensureAttributesNamespaceIsDeclared(                            uri,                            localName,                            rawName);                }                catch (SAXException e)                {                    // TODO Auto-generated catch block                    e.printStackTrace();                }            }            m_attributes.addAttribute(uri, localName, rawName, type, value);            was_added = true;            if (m_tracer != null)                firePseudoAttributes();        }        return was_added;    }