<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.domdocument.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'domdocument.createattributens.php',
    1 => 'DOMDocument::createAttributeNS',
    2 => 'Create new attribute node with an associated namespace',
  ),
  'up' => 
  array (
    0 => 'class.domdocument.php',
    1 => 'DOMDocument',
  ),
  'prev' => 
  array (
    0 => 'domdocument.createattribute.php',
    1 => 'DOMDocument::createAttribute',
  ),
  'next' => 
  array (
    0 => 'domdocument.createcdatasection.php',
    1 => 'DOMDocument::createCDATASection',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/dom/domdocument/createattributens.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="domdocument.createattributens" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">DOMDocument::createAttributeNS</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">DOMDocument::createAttributeNS</span> &mdash; <span class="dc-title">
   Create new attribute node with an associated namespace
  </span></p>

 </div>
 <div class="refsect1 description" id="refsect1-domdocument.createattributens-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>DOMDocument::createAttributeNS</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$namespace</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$qualifiedName</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.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   This function creates a new instance of class
   <span class="classname"><a href="class.domattr.php" class="classname">DOMAttr</a></span>. Dieser Knoten wird im Dokument erst dann angezeigt, wenn er mit (z. B.)
<span class="function"><a href="domnode.appendchild.php" class="function">DOMNode::appendChild()</a></span> eingefügt wird.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-domdocument.createattributens-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">namespace</code></dt>
     <dd>
      <p class="para">
       The URI of the namespace.
      </p>
     </dd>
    
    
     <dt><code class="parameter">qualifiedName</code></dt>
     <dd>
      <p class="para">
       The tag name and prefix of the attribute, as <code class="literal">prefix:tagname</code>.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-domdocument.createattributens-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   The new <span class="classname"><a href="class.domattr.php" class="classname">DOMAttr</a></span> or <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> if an error occurred.
  </p>
 </div>

 <div class="refsect1 errors" id="refsect1-domdocument.createattributens-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-invalid-character-err">DOM_INVALID_CHARACTER_ERR</a></code></strong></dt>
     <dd>
      <p class="para">
       Raised if <code class="parameter">qualifiedName</code> contains an invalid character.
      </p>
     </dd>
    
    
     <dt><strong><code><a href="dom.constants.php#constant.dom-namespace-err">DOM_NAMESPACE_ERR</a></code></strong></dt>
     <dd>
      <p class="para">
       Raised if <code class="parameter">qualifiedName</code> is a malformed qualified
       name, or if <code class="parameter">qualifiedName</code> has a prefix and 
       <code class="parameter">namespace</code> is <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>

 <div class="refsect1 changelog" id="refsect1-domdocument.createattributens-changelog">
  <h3 class="title">Changelog</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Beschreibung</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.3.0</td>
      <td>
       Calling this method without specifying a prefix will now choose a prefix instead of assuming the default namespace.
       Previously this would create an attribute without a prefix and incorrectly apply the namespace
       to the owner element because default namespaces don&#039;t apply on attributes.
      </td>
     </tr>

     <tr>
      <td>8.3.0</td>
      <td>
       Calling this method using a prefix that was already declared on the owner element with a different namespace URI
       will now change the new prefix to avoid creating namespace conflicts. This aligns the behaviour with the DOM specification.
       Previously this threw a <span class="classname"><a href="class.domexception.php" class="classname">DOMException</a></span> with code <strong><code><a href="dom.constants.php#constant.dom-namespace-err">DOM_NAMESPACE_ERR</a></code></strong>.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>

 <div class="refsect1 seealso" id="refsect1-domdocument.createattributens-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="methodname"><a href="domnode.appendchild.php" class="methodname" rel="rdfs-seeAlso">DOMNode::appendChild()</a> - Adds new child at the end of the children</span></li>
    <li><span class="methodname"><a href="domdocument.createattribute.php" class="methodname" rel="rdfs-seeAlso">DOMDocument::createAttribute()</a> - Create new attribute</span></li>
    <li><span class="methodname"><a href="domdocument.createcdatasection.php" class="methodname" rel="rdfs-seeAlso">DOMDocument::createCDATASection()</a> - Create new cdata node</span></li>
    <li><span class="methodname"><a href="domdocument.createcomment.php" class="methodname" rel="rdfs-seeAlso">DOMDocument::createComment()</a> - Create new comment node</span></li>
    <li><span class="methodname"><a href="domdocument.createdocumentfragment.php" class="methodname" rel="rdfs-seeAlso">DOMDocument::createDocumentFragment()</a> - Create new document fragment</span></li>
    <li><span class="methodname"><a href="domdocument.createelement.php" class="methodname" rel="rdfs-seeAlso">DOMDocument::createElement()</a> - Create new element node</span></li>
    <li><span class="methodname"><a href="domdocument.createelementns.php" class="methodname" rel="rdfs-seeAlso">DOMDocument::createElementNS()</a> - Create new element node with an associated namespace</span></li>
    <li><span class="methodname"><a href="domdocument.createentityreference.php" class="methodname" rel="rdfs-seeAlso">DOMDocument::createEntityReference()</a> - Create new entity reference node</span></li>
    <li><span class="methodname"><a href="domdocument.createprocessinginstruction.php" class="methodname" rel="rdfs-seeAlso">DOMDocument::createProcessingInstruction()</a> - Creates new PI node</span></li>
    <li><span class="methodname"><a href="domdocument.createtextnode.php" class="methodname" rel="rdfs-seeAlso">DOMDocument::createTextNode()</a> - Create new text node</span></li>
   </ul>
  </p>
 </div>

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