<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>DOM.NamedNodeMap</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <link rel="stylesheet" type="text/css" href="../common/doxygen.css" /> <link rel="stylesheet" media="screen" type="text/css" title="KDE Colors" href="../common/kde.css" /> </head> <body> <div id="container"> <div id="header"> <div id="header_top"> <div> <div> <img alt ="" src="../common/top-kde.jpg"/> KDE 4.4 PyKDE API Reference </div> </div> </div> <div id="header_bottom"> <div id="location"> <ul> <li>KDE's Python API</li> </ul> </div> <div id="menu"> <ul> <li><a href="../modules.html">Overview</a></li> <li><a href="http://techbase.kde.org/Development/Languages/Python">PyKDE Home</a></li> <li><a href="http://kde.org/family/">Sitemap</a></li> <li><a href="http://kde.org/contact/">Contact Us</a></li> </ul> </div> </div> </div> <div id="body_wrapper"> <div id="body"> <div id="right"> <div class="content"> <div id="main"> <div class="clearer"> </div> <h1>NamedNodeMap Class Reference</h1> <code>from PyKDE4.khtml import *</code> <p> Namespace: DOM.NamedNodeMap<br /> <h2>Detailed Description</h2> <p>Objects implementing the NamedNodeMap interface are used to represent collections of nodes that can be accessed by name. Note that NamedNodeMap does not inherit from NodeList ; NamedNodeMap s are not maintained in any particular order. Objects contained in an object implementing NamedNodeMap may also be accessed by an ordinal index, but this is simply to allow convenient enumeration of the contents of a NamedNodeMap , and does not imply that the DOM specifies an order to these Nodes. </p> <table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="2"><br><h2>Methods</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#NamedNodeMap">__init__</a> (self)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#NamedNodeMap">__init__</a> (self, <a href="../khtml/DOM.NamedNodeMap.html">DOM.NamedNodeMap</a> other)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../khtml/DOM.Node.html">DOM.Node</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#getNamedItem">getNamedItem</a> (self, <a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> name)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../khtml/DOM.Node.html">DOM.Node</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#getNamedItemNS">getNamedItemNS</a> (self, <a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> namespaceURI, <a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> localName)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#isNull">isNull</a> (self)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../khtml/DOM.Node.html">DOM.Node</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#item">item</a> (self, long index)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">long </td><td class="memItemRight" valign="bottom"><a class="el" href="#length">length</a> (self)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../khtml/DOM.Node.html">DOM.Node</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#removeNamedItem">removeNamedItem</a> (self, <a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> name)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../khtml/DOM.Node.html">DOM.Node</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#removeNamedItemNS">removeNamedItemNS</a> (self, <a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> namespaceURI, <a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> localName)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../khtml/DOM.Node.html">DOM.Node</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setNamedItem">setNamedItem</a> (self, <a href="../khtml/DOM.Node.html">DOM.Node</a> arg)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../khtml/DOM.Node.html">DOM.Node</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setNamedItemNS">setNamedItemNS</a> (self, <a href="../khtml/DOM.Node.html">DOM.Node</a> arg)</td></tr> </table> <hr><h2>Method Documentation</h2><a class="anchor" name="NamedNodeMap"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname">__init__</td> <td>(</td> <td class="paramtype"> </td> <td class="paramname"><em>self</em> )</td> <td width="100%"> </td> </tr> </table> </div> <div class="memdoc"></div></div><a class="anchor" name="NamedNodeMap"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname">__init__</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype"><a href="../khtml/DOM.NamedNodeMap.html">DOM.NamedNodeMap</a> </td> <td class="paramname"><em>other</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"></div></div><a class="anchor" name="getNamedItem"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"><a href="../khtml/DOM.Node.html">DOM.Node</a> getNamedItem</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype"><a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> </td> <td class="paramname"><em>name</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>Retrieves a node specified by name. </p> <p> </p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign="top"><em>name</em> </td><td> Name of a node to retrieve. </td></tr> </table></dl> <p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> A Node (of any type) with the specified name, or null if the specified name did not identify any node in the map. </dd></dl> </p></div></div><a class="anchor" name="getNamedItemNS"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"><a href="../khtml/DOM.Node.html">DOM.Node</a> getNamedItemNS</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype"><a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> </td> <td class="paramname"><em>namespaceURI</em>, </td> </tr> <tr> <td class="memname"></td> <td></td> <td class="paramtype"><a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> </td> <td class="paramname"><em>localName</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>Introduced in DOM Level 2 </p> <p> Retrieves a node specified by local name and namespace URI. HTML-only DOM implementations do not need to implement this method. </p> <p> </p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign="top"><em>namespaceURI</em> </td><td> The namespace URI of the node to retrieve. </td></tr> <tr><td></td><td valign="top"><em>localName</em> </td><td> The local name of the node to retrieve. </td></tr> </table></dl> <p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> A Node (of any type) with the specified local name and namespace URI, or null if they do not identify any node in this map. </dd></dl> </p></div></div><a class="anchor" name="isNull"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname">bool isNull</td> <td>(</td> <td class="paramtype"> </td> <td class="paramname"><em>self</em> )</td> <td width="100%"> </td> </tr> </table> </div> <div class="memdoc"></div></div><a class="anchor" name="item"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"><a href="../khtml/DOM.Node.html">DOM.Node</a> item</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype">long </td> <td class="paramname"><em>index</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>Returns the index th item in the map. If index is greater than or equal to the number of nodes in the map, this returns null . </p> <p> </p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign="top"><em>index</em> </td><td> Index into the map. </td></tr> </table></dl> <p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> The node at the index th position in the </dd></dl> NamedNodeMap , or null if that is not a valid index. </p></div></div><a class="anchor" name="length"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname">long length</td> <td>(</td> <td class="paramtype"> </td> <td class="paramname"><em>self</em> )</td> <td width="100%"> </td> </tr> </table> </div> <div class="memdoc"><p>The number of nodes in the map. The range of valid child node indices is 0 to length-1 inclusive. </p></div></div><a class="anchor" name="removeNamedItem"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"><a href="../khtml/DOM.Node.html">DOM.Node</a> removeNamedItem</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype"><a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> </td> <td class="paramname"><em>name</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>Removes a node specified by name. If the removed node is an Attr with a default value it is immediately replaced. </p> <p> </p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign="top"><em>name</em> </td><td> The name of a node to remove. </td></tr> </table></dl> <p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> The node removed from the map or null if no node with such a name exists. </dd></dl> </p> <p> DOMException NOT_FOUND_ERR: Raised if there is no node named name in the map. </p></div></div><a class="anchor" name="removeNamedItemNS"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"><a href="../khtml/DOM.Node.html">DOM.Node</a> removeNamedItemNS</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype"><a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> </td> <td class="paramname"><em>namespaceURI</em>, </td> </tr> <tr> <td class="memname"></td> <td></td> <td class="paramtype"><a href="../khtml/DOM.DOMString.html">DOM.DOMString</a> </td> <td class="paramname"><em>localName</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>Introduced in DOM Level 2 </p> <p> Removes a node specified by local name and namespace URI. A removed attribute may be known to have a default value when this map contains the attributes attached to an element, as returned by the attributes attribute of the Node interface. If so, an attribute immediately appears containing the default value as well as the corresponding namespace URI, local name, and prefix when applicable. HTML-only DOM implementations do not need to implement this method. </p> <p> </p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign="top"><em>namespaceURI</em> </td><td> The namespace URI of the node to remove. </td></tr> <tr><td></td><td valign="top"><em>localName</em> </td><td> The local name of the node to remove. </td></tr> </table></dl> <p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> The node removed from this map if a node with such a local name and namespace URI exists. </dd></dl> </p> <p> DOMException NOT_FOUND_ERR: Raised if there is no node with the specified namespaceURI and localName in this map. </p> <p> NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly. </p></div></div><a class="anchor" name="setNamedItem"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"><a href="../khtml/DOM.Node.html">DOM.Node</a> setNamedItem</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype"><a href="../khtml/DOM.Node.html">DOM.Node</a> </td> <td class="paramname"><em>arg</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>Adds a node using its nodeName attribute. </p> <p> As the nodeName attribute is used to derive the name which the node must be stored under, multiple nodes of certain types (those that have a "special" string value) cannot be stored as the names would clash. This is seen as preferable to allowing nodes to be aliased. </p> <p> </p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign="top"><em>arg</em> </td><td> A node to store in a named node map. The node will later be accessible using the value of the nodeName attribute of the node. If a node with that name is already present in the map, it is replaced by the new one. </td></tr> </table></dl> <p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> If the new Node replaces an existing node with the same name the previously existing Node is returned, otherwise null is returned. </dd></dl> </p> <p> DOMException WRONG_DOCUMENT_ERR: Raised if arg was created from a different document than the one that created the NamedNodeMap . </p> <p> NO_MODIFICATION_ALLOWED_ERR: Raised if this NamedNodeMap is readonly. </p> <p> INUSE_ATTRIBUTE_ERR: Raised if arg is an Attr that is already an attribute of another Element object. The DOM user must explicitly clone Attr nodes to re-use them in other elements. </p></div></div><a class="anchor" name="setNamedItemNS"></a> <div class="memitem"> <div class="memproto"> <table class="memname"><tr> <td class="memname"><a href="../khtml/DOM.Node.html">DOM.Node</a> setNamedItemNS</td> <td>(</td> <td class="paramtype"> <em>self</em>, </td> <td class="paramname"></td> </tr><tr> <td class="memname"></td> <td></td> <td class="paramtype"><a href="../khtml/DOM.Node.html">DOM.Node</a> </td> <td class="paramname"><em>arg</em></td> </tr> <tr> <td></td> <td>)</td> <td></td> <td></td> <td width="100%"> </td> </tr></table> </div> <div class="memdoc"><p>Introduced in DOM Level 2 </p> <p> Adds a node using its namespaceURI and localName. If a node with that namespace URI and that local name is already present in this map, it is replaced by the new one. HTML-only DOM implementations do not need to implement this method. </p> <p> </p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign="top"><em>arg</em> </td><td> A node to store in this map. The node will later be accessible using the value of its namespaceURI and localName attributes. </td></tr> </table></dl> <p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> If the new Node replaces an existing node the replaced Node is returned, otherwise null is returned. </dd></dl> </p> <p> DOMException WRONG_DOCUMENT_ERR: Raised if arg was created from a different document than the one that created this map. </p> <p> NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly. </p> <p> INUSE_ATTRIBUTE_ERR: Raised if arg is an Attr that is already an attribute of another Element object. The DOM user must explicitly clone Attr nodes to re-use them in other elements. </p></div></div> </div> </div> </div> <div id="left"> <div class="menu_box"> <div class="nav_list"> <ul> <li><a href="../allclasses.html">Full Index</a></li> </ul> </div> <a name="cp-menu" /><div class="menutitle"><div> <h2 id="cp-menu-project">Modules</h2> </div></div> <div class="nav_list"> <ul><li><a href="../akonadi/index.html">akonadi</a></li> <li><a href="../dnssd/index.html">dnssd</a></li> <li><a href="../kdecore/index.html">kdecore</a></li> <li><a href="../kdeui/index.html">kdeui</a></li> <li><a href="../khtml/index.html">khtml</a></li> <li><a href="../kio/index.html">kio</a></li> <li><a href="../knewstuff/index.html">knewstuff</a></li> <li><a href="../kparts/index.html">kparts</a></li> <li><a href="../kutils/index.html">kutils</a></li> <li><a href="../nepomuk/index.html">nepomuk</a></li> <li><a href="../phonon/index.html">phonon</a></li> <li><a href="../plasma/index.html">plasma</a></li> <li><a href="../polkitqt/index.html">polkitqt</a></li> <li><a href="../solid/index.html">solid</a></li> <li><a href="../soprano/index.html">soprano</a></li> </ul></div></div> </div> </div> <div class="clearer"/> </div> <div id="end_body"></div> </div> <div id="footer"><div id="footer_text"> This documentation is maintained by <a href="mailto:simon@simonzone.com">Simon Edwards</a>.<br /> KDE<sup>®</sup> and <a href="../images/kde_gear_black.png">the K Desktop Environment<sup>®</sup> logo</a> are registered trademarks of <a href="http://ev.kde.org/" title="Homepage of the KDE non-profit Organization">KDE e.V.</a> | <a href="http://www.kde.org/contact/impressum.php">Legal</a> </div></div> </body> </html>