int index = getIndex(name); if (index<0) {
boolean found = false; for (int i = 0; i < attrsEnd; i++) { AttrImpl attr = (AttrImpl)m_children[i]; if (attr.getNodeName().equals(name)) { m_children[i] = attrImpl; found = true; break; } } if (!found) {
  public Attr               createAttribute(String name)    throws DOMException  {    // System.out.println("name: "+name);    AttrImpl attrImpl;    if(QName.isXMLNSDecl(name))    {      attrImpl = new NameSpaceDecl("http://www.w3.org/2000/xmlns/",                                    name, "");    }    else      attrImpl = new AttrImpl(name, "");    int index = getIndex(name);    if (index<0)    {        appendChild(attrImpl);      attrsEnd++;    }    else      m_children[index] = attrImpl;    return (Attr)attrImpl;      }