if (attrName == null) { attrName = attr.getNodeName(); }
  protected void setHTMLAttribute(String name, String value)  {    Node attr;    NamedNodeMap attrs = getAttributes();    int len = attrs.getLength();    for (int i = 0; i < len; i++)      {        attr = attrs.item(i);        String attrName = attr.getLocalName();        if (attrName.equalsIgnoreCase(name))          {            if (value != null)              {                attr.setNodeValue(value);              }            else              {                attrs.removeNamedItem(attr.getNodeName());              }            return;          }      }    if (value != null)      {        // Create a new attribute        DomHTMLDocument doc = (DomHTMLDocument) getOwnerDocument();        // XXX namespace URI for attribute?        attr = doc.createAttribute(name);        attr.setNodeValue(value);      }  }