Adds  the given attribute to the set of collected attributes,
but only if there is a currently open element.

@param name the attribute's qualified name
@param value the value of the attribute
431164
public void addAttribute(String name, final String value)
    {
        if (m_elemContext.m_startTagOpen)
        {
            final String patchedName = patchName(name);
            final String localName = getLocalName(patchedName);
            final String uri = getNamespaceURI(patchedName, false);

            addAttributeAlways(uri,localName, patchedName, "CDATA", value, false);
         }
    }
769183
private void setAttrValue(final AttrName _attrName,
                              final String _value)
    {
        synchronized (this.attrValues) {
            this.attrValues.put(_attrName, _value);
        }
    }
955407
private static void addAttribute(Element element, Set<Attr> attributes, Object value) {
		Attr attr = (Attr) value;
		if (!attributes.add(attr)) {
			throw new TemplateException("Invalid element |%s|. It has both static attribute |%s| and attribute operator.", element, attr.getName());
		}
	}
1010460
public void setAttribute(String key, Object value) {

        if (m_attributes == null) {
            m_attributes = new HashMap<String, Object>(4);
        }
        m_attributes.put(key, value);
    }
1228487
public function setAttribute( $name, $value )
    {
        if ( isset( $this->dynamicAttributeFunctions[$name] ) )
        {
            switch ( $name )
            {
                case 'valid_nodes':
                    $this->dynamicAttributeFunctions[$name] = $value;
                    break;
                default:
                break;
            }
        }
        else
        {
            $this->attributes[$name] = $value;
        }
    }
1289505
public void addAttribute(String name, String value) {
        checkType(name, String.class);
        attributes.put(name, value);
    }
525665
public Node attribute(final String name, final Object value) {
        return attribute(name, String.valueOf(value));
    }
329744
public String setAttribute(final String name, final String value) {
        if(null!=value){
            return getAttributes().put(name, value);
        }else{
            getAttributes().remove(name);
            return value;
        }
    }
24472
public void addParameter( String name, String value )
    {
        if ( _additionalParameters == null )
        {
            _additionalParameters = new HashMap();
        }
        
        _additionalParameters.put( name, value );
    }
990650
def set(self, name, value):
        
        attr = self.getAttribute(name)
        if attr is None:
            attr = Attribute(name, value)
            self.append(attr)
        else:
            attr.setValue(value)
857089
public void setAttribute(final String name, final Attribute attribute) {
        if (name.equals(MAP_KEY)) {
            this.mapAttribute = (MapAttribute) attribute;
        }
    }
246412
@Override
	public void setAttribute(String name, Object value) {
		attributesSupport.setAttribute(name, value);
	}
91277
public void setAttribute(final String name, final Attribute attribute) {
        if (name.equals("datasource")) {
            this.allAttributes.putAll(((DataSourceAttribute) attribute).getAttributes());
        } else if (this.copyAttributes.contains(name)) {
            this.allAttributes.put(name, attribute);
        }
    }
785606
public void setIntegerAttribute(String name, Integer value) {
		ensureValue();
		Attribute attribute = new IntegerAttribute(value);
		attribute.setEditable(isEditable(name));
		getValue().getAllAttributes().put(name, attribute);
	}
122911
public XMLAttributeList addAttribute(@Nonnull String name, @Nonnull String value) {
        if (name == null) {
            throw new NullPointerException("name must be nonnull");
        }
        if (value == null) {
            throw new NullPointerException("value must be nonnull");
        }
        nameValuePairList.add(new NameValuePair(name, value));
        return this;
    }
781781
public void addAttribute(String localName, String value) {
        if ("id".equals(localName)) {
            super.addAttribute("", localName, localName, "ID", value);
        } else {
            super.addAttribute("", localName, localName, "CDATA", value);
        }
    }
69251
public void setBooleanAttribute(String name, Boolean value) {
		ensureValue();
		Attribute attribute = new BooleanAttribute(value);
		attribute.setEditable(isEditable(name));
		getValue().getAllAttributes().put(name, attribute);
	}