public void writeAttribute(String localName, String value)
774610
@Override
    public void writeAttribute(String nsURI, String localName, String value)
        throws XMLStreamException
    {
        // No need to set mAnyOutput, nor close the element
        if (!mStartElementOpen) {
            throwOutputError(ErrorConsts.WERR_ATTR_NO_ELEM);
        }
        String prefix = mCurrElem.getExplicitPrefix(nsURI);
        if (!mReturnNullForDefaultNamespace && prefix == null) {
            throwOutputError("Unbound namespace URI '" + nsURI + "'");
        }
        doWriteAttr(localName, nsURI, prefix, value);
    }
895523
protected void writeAttributeValue(String value, Writer out) throws IOException {
		// .[apostrophe and <, & escaped],
		final char quot = attributeUseApostrophe ? '\'' : '"';
		final String quotEntity = attributeUseApostrophe ? "&apos;" : "&quot;";

		int pos = 0;
		for (int i = 0; i < value.length(); i++) {
			char ch = value.charAt(i);
			if (ch == '&') {
				if (i > pos)
					out.write(value.substring(pos, i));
				out.write("&amp;");
				pos = i + 1;
			}
			if (ch == '<') {
				if (i > pos)
					out.write(value.substring(pos, i));
				out.write("&lt;");
				pos = i + 1;
			} else if (ch == quot) {
				if (i > pos)
					out.write(value.substring(pos, i));
				out.write(quotEntity);
				pos = i + 1;
			} else if (ch < 32) {
				// in XML 1.0 only legal character are #x9 | #xA | #xD
				// and they must be escaped otherwise in attribute value they
				// are normalized to spaces
				if (ch == 13 || ch == 10 || ch == 9) {
					if (i > pos)
						out.write(value.substring(pos, i));
					out.write("&#");
					out.write(Integer.toString(ch));
					out.write(';');
					pos = i + 1;
				} else {
					if (TRACE_ESCAPING)
						System.err.println(getClass().getName() + " DEBUG ATTR value.len=" + value.length() + " " + printable(value));

					throw new IllegalStateException(
							// "character "+Integer.toString(ch)+" is not
							// allowed in output"+getLocation());
							"character " + printable(ch) + " (" + Integer.toString(ch) + ") is not allowed in output" + getLocation() + " (attr value=" + printable(value) + ")");
					// in XML 1.1 legal are [#x1-#xD7FF]
					// if(ch > 0) {
					// if(i > pos) out.write(text.substring(pos, i));
					// out.write("&#");
					// out.write(Integer.toString(ch));
					// out.write(';');
					// pos = i + 1;
					// } else {
					// throw new IllegalStateException(
					// "character zero is not allowed in XML 1.1
					// output"+getLocation());
					// }
				}
			}
		}
		if (pos > 0) {
			out.write(value.substring(pos));
		} else {
			out.write(value); // this is shortcut to the most common case
		}

	}
1236018
def write_attribute(name, value)
      name = name.to_s
      modify(name, @attributes[name], value)
    end
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);
        }
    }
1010460
public void setAttribute(String key, Object value) {

        if (m_attributes == null) {
            m_attributes = new HashMap<String, Object>(4);
        }
        m_attributes.put(key, value);
    }
1044933
public void setAttr(String attr, Object val) throws NamingException {
    getAttributes().put(attr, val);
  }
715906
private StringBuilder appendAttributeValue(final String value, final StringBuilder buf) {
      if(value.contains("\"")) {
         buf.append("\'").append(escapeAttribute(value)).append("\'");
      } else if(value.contains(" ") || value.contains("\'") || value.contains("=")) {
         buf.append("\"").append(escapeAttribute(value)).append("\"");
      } else {
         buf.append(escapeAttribute(value));
      }
      return buf;
   }
1258940
private void buildAttributeValueObject(final String name) {
	attrval.name = name;
	attrval.quality = AttrQuality.ATTR_VALID;
	attrval.time = new TimeVal();
	attrval.r_dim = new AttributeDim();
	attrval.w_dim = new AttributeDim();
	attrval.r_dim.dim_x = 1;
	attrval.r_dim.dim_y = 0;
	attrval.w_dim.dim_x = 0;
	attrval.w_dim.dim_y = 0;
	try {
	    attrval.value = ApiUtil.get_orb().create_any();
	} catch (final DevFailed e) {
	}

	final long now = System.currentTimeMillis();
	attrval.time.tv_sec = (int) (now / 1000);
	attrval.time.tv_usec = (int) (now - attrval.time.tv_sec * 1000) * 1000;
	attrval.time.tv_nsec = 0;
	attrval.err_list = null;
    }
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);
         }
    }
581325
@Override
    public void writeBooleanAttribute(String prefix, String nsURI, String localName, boolean value)
        throws XMLStreamException
    {
        writeTypedAttribute(prefix, nsURI, localName,
                            valueEncoderFactory().getEncoder(value));
    }
18341
public void writeProperty(String name, String value) {
        writeElement(name, OPENING);
        _buffer.append(value);
        writeElement(name, CLOSING);
    }
211984
private void write(String attribute, String content)
    {
        Check.notNull(attribute);
        Check.notNull(content);

        try
        {
            root.setAttribute(attribute, content);
        }
        catch (final DOMException exception)
        {
            throw new LionEngineException(exception, ERROR_WRITE_ATTRIBUTE + attribute + ERROR_WRITE_CONTENT + content);
        }
    }
986674
int writeAttr(Name attrName) {
        databuf.appendChar(pool.put(attrName));
        databuf.appendInt(0);
        return databuf.length;
    }
588304
public B attr(String name, String value) {
        get().setAttribute(name, value);
        return that();
    }
760340
public void setAttribute(ObjectName name, String attrName, Object value) throws Exception {
		checkClientConnected();
		Attribute attribute = new Attribute(attrName, value);
		mbeanConn.setAttribute(name, attribute);
	}
533697
protected void attributeImpl(String name, String value) {
        if (! (this.xmlNode instanceof Element)) {
            throw new RuntimeException(
                "Cannot add an attribute to non-Element underlying node: "
                + this.xmlNode);
        }
        ((Element) xmlNode).setAttribute(name, value);
    }
790317
protected void prepareAttribute(StringBuffer handlers, String name, Object value) {
		if (value != null) {
			handlers.append(" ");
			handlers.append(name);
			handlers.append("=\"");
			handlers.append(value);
			handlers.append("\"");
		}
	}