<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="domelement.setattributenode" xmlns="http://docbook.org/ns/docbook">
 <refnamediv>
  <refname>DOMElement::setAttributeNode</refname>
  <refpurpose>Adds new attribute node to element</refpurpose>
 </refnamediv>
 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis role="DOMElement">
   <modifier>public</modifier> <type class="union"><type>DOMAttr</type><type>null</type><type>false</type></type><methodname>DOMElement::setAttributeNode</methodname>
   <methodparam><type>DOMAttr</type><parameter>attr</parameter></methodparam>
  </methodsynopsis>
  <para>
   Adds new attribute node <parameter>attr</parameter> to element. 
   If an attribute with the same name already exists on the element, that attribute is replaced by <parameter>attr</parameter>.
  </para>
 </refsect1>
 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>attr</parameter></term>
     <listitem>
      <para>
       The attribute node.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>
 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   Returns the old attribute if it has been replaced or &null; if there was no old attribute.
   If a <constant>DOM_WRONG_DOCUMENT_ERR</constant> error is raised, and <varname linkend="domdocument.props.stricterrorchecking">strictErrorChecking</varname> is &false;, &false; is returned.
  </para>
 </refsect1>
 <refsect1 role="errors">
  &reftitle.errors;
  <para>
   <variablelist>
    <varlistentry>
     <term><constant>DOM_WRONG_DOCUMENT_ERR</constant></term>
     <listitem>
      <para>
       Raised if <parameter>attr</parameter> belongs to a different document than the element.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>
 <refsect1 role="seealso">
  &reftitle.seealso;
  <para>
   <simplelist>
    <member><methodname>DOMElement::hasAttribute</methodname></member>
    <member><methodname>DOMElement::getAttributeNode</methodname></member>
    <member><methodname>DOMElement::removeAttributeNode</methodname></member>
   </simplelist>
  </para>
 </refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
