<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.domelement.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'domelement.setattributenodens.php',
    1 => 'DOMElement::setAttributeNodeNS',
    2 => 'Adds new attribute node to element',
  ),
  'up' => 
  array (
    0 => 'class.domelement.php',
    1 => 'DOMElement',
  ),
  'prev' => 
  array (
    0 => 'domelement.setattributenode.php',
    1 => 'DOMElement::setAttributeNode',
  ),
  'next' => 
  array (
    0 => 'domelement.setattributens.php',
    1 => 'DOMElement::setAttributeNS',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/dom/domelement/setattributenodens.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="domelement.setattributenodens" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">DOMElement::setAttributeNodeNS</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">DOMElement::setAttributeNodeNS</span> &mdash; <span class="dc-title">Adds new attribute node to element</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-domelement.setattributenodens-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>DOMElement::setAttributeNodeNS</strong></span>(<span class="methodparam"><span class="type"><a href="class.domattr.php" class="type DOMAttr">DOMAttr</a></span> <code class="parameter">$attr</code></span>): <span class="type"><span class="type"><a href="class.domattr.php" class="type DOMAttr">DOMAttr</a></span>|<span class="type"><a href="language.types.null.php" class="type null">null</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Adds new attribute node <code class="parameter">attr</code> to element, keeping the namespace into account.
   If an attribute with the same name already exists on the element, that attribute is replaced by <code class="parameter">attr</code>.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-domelement.setattributenodens-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">attr</code></dt>
     <dd>
      <p class="para">
       The attribute node.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-domelement.setattributenodens-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Returns the old attribute if it has been replaced or <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> if there was no old attribute.
   If a <strong><code><a href="dom.constants.php#constant.dom-wrong-document-err">DOM_WRONG_DOCUMENT_ERR</a></code></strong> error is raised, and <var class="varname">strictErrorChecking</var> is <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> is returned.
  </p>
 </div>

 <div class="refsect1 errors" id="refsect1-domelement.setattributenodens-errors">
  <h3 class="title">Fehler/Exceptions</h3>
  <p class="simpara">
   May throw a <span class="exceptionname"><a href="class.domexception.php" class="exceptionname">DOMException</a></span> with the
   following error codes:
  </p>
  <p class="para">
   <dl>
    
     <dt><strong><code><a href="dom.constants.php#constant.dom-wrong-document-err">DOM_WRONG_DOCUMENT_ERR</a></code></strong></dt>
     <dd>
      <p class="para">
       Raised if <code class="parameter">attr</code> belongs to a different document than the element.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>

 <div class="refsect1 seealso" id="refsect1-domelement.setattributenodens-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="methodname"><a href="domelement.hasattributens.php" class="methodname" rel="rdfs-seeAlso">DOMElement::hasAttributeNS()</a> - Checks to see if attribute exists</span></li>
    <li><span class="methodname"><a href="domelement.getattributenodens.php" class="methodname" rel="rdfs-seeAlso">DOMElement::getAttributeNodeNS()</a> - Returns attribute node</span></li>
    <li><span class="methodname"><a href="domelement.removeattributenode.php" class="methodname" rel="rdfs-seeAlso">DOMElement::removeAttributeNode()</a> - Removes attribute</span></li>
   </ul>
  </p>
 </div>

</div><?php manual_footer($setup); ?>