📄 namednodemap.html
字号:
public <A HREF="../../../org/w3c/dom/Node.html">Node</A> <B>setNamedItem</B>(<A HREF="../../../org/w3c/dom/Node.html">Node</A> arg) throws <A HREF="../../../org/w3c/dom/DOMException.html">DOMException</A></PRE><DL><DD>Adds a node using its <code>nodeName</code> attribute. If a node with that name is already present in this map, it is replaced by the new one. <br>As the <code>nodeName</code> 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.<DD><DL><DT><B>Parameters:</B><DD><CODE>arg</CODE> - A node to store in this map. The node will later be accessible using the value of its <code>nodeName</code> attribute.<DT><B>Returns:</B><DD>If the new <code>Node</code> replaces an existing node the replaced <code>Node</code> is returned, otherwise <code>null</code> is returned.<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/w3c/dom/DOMException.html">DOMException</A></CODE> - WRONG_DOCUMENT_ERR: Raised if <code>arg</code> was created from a different document than the one that created this map. <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly. <br>INUSE_ATTRIBUTE_ERR: Raised if <code>arg</code> is an <code>Attr</code> that is already an attribute of another <code>Element</code> object. The DOM user must explicitly clone <code>Attr</code> nodes to re-use them in other elements. <br>HIERARCHY_REQUEST_ERR: Raised if an attempt is made to add a node doesn't belong in this NamedNodeMap. Examples would include trying to insert something other than an Attr node into an Element's map of attributes, or a non-Entity node into the DocumentType's map of Entities.</DL></DD></DL><HR><A NAME="removeNamedItem(java.lang.String)"><!-- --></A><H3>removeNamedItem</H3><PRE>public <A HREF="../../../org/w3c/dom/Node.html">Node</A> <B>removeNamedItem</B>(java.lang.String name) throws <A HREF="../../../org/w3c/dom/DOMException.html">DOMException</A></PRE><DL><DD>Removes a node specified by name. When this map contains the attributes attached to an element, if the removed attribute is known to have a default value, an attribute immediately appears containing the default value as well as the corresponding namespace URI, local name, and prefix when applicable.<DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - The <code>nodeName</code> of the node to remove.<DT><B>Returns:</B><DD>The node removed from this map if a node with such a name exists.<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/w3c/dom/DOMException.html">DOMException</A></CODE> - NOT_FOUND_ERR: Raised if there is no node named <code>name</code> in this map. <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.</DL></DD></DL><HR><A NAME="item(int)"><!-- --></A><H3>item</H3><PRE>public <A HREF="../../../org/w3c/dom/Node.html">Node</A> <B>item</B>(int index)</PRE><DL><DD>Returns the <code>index</code>th item in the map. If <code>index</code> is greater than or equal to the number of nodes in this map, this returns <code>null</code>.<DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - Index into this map.<DT><B>Returns:</B><DD>The node at the <code>index</code>th position in the map, or <code>null</code> if that is not a valid index.</DL></DD></DL><HR><A NAME="getLength()"><!-- --></A><H3>getLength</H3><PRE>public int <B>getLength</B>()</PRE><DL><DD>The number of nodes in this map. The range of valid child node indices is <code>0</code> to <code>length-1</code> inclusive.</DL><HR><A NAME="getNamedItemNS(java.lang.String, java.lang.String)"><!-- --></A><H3>getNamedItemNS</H3><PRE>public <A HREF="../../../org/w3c/dom/Node.html">Node</A> <B>getNamedItemNS</B>(java.lang.String namespaceURI, java.lang.String localName)</PRE><DL><DD>Retrieves a node specified by local name and namespace URI. <br>Documents which do not support the "XML" feature will permit only the DOM Level 1 calls for creating/setting elements and attributes. Hence, if you specify a non-null namespace URI, these DOMs will never find a matching node.<DD><DL><DT><B>Parameters:</B><DD><CODE>namespaceURI</CODE> - The namespace URI of the node to retrieve.<DD><CODE>localName</CODE> - The local name of the node to retrieve.<DT><B>Returns:</B><DD>A <code>Node</code> (of any type) with the specified local name and namespace URI, or <code>null</code> if they do not identify any node in this map.<DT><B>Since: </B><DD>DOM Level 2</DD></DL></DD></DL><HR><A NAME="setNamedItemNS(org.w3c.dom.Node)"><!-- --></A><H3>setNamedItemNS</H3><PRE>public <A HREF="../../../org/w3c/dom/Node.html">Node</A> <B>setNamedItemNS</B>(<A HREF="../../../org/w3c/dom/Node.html">Node</A> arg) throws <A HREF="../../../org/w3c/dom/DOMException.html">DOMException</A></PRE><DL><DD>Adds a node using its <code>namespaceURI</code> and <code>localName</code>. If a node with that namespace URI and that local name is already present in this map, it is replaced by the new one.<DD><DL><DT><B>Parameters:</B><DD><CODE>arg</CODE> - A node to store in this map. The node will later be accessible using the value of its <code>namespaceURI</code> and <code>localName</code> attributes.<DT><B>Returns:</B><DD>If the new <code>Node</code> replaces an existing node the replaced <code>Node</code> is returned, otherwise <code>null</code> is returned.<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/w3c/dom/DOMException.html">DOMException</A></CODE> - WRONG_DOCUMENT_ERR: Raised if <code>arg</code> was created from a different document than the one that created this map. <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly. <br>INUSE_ATTRIBUTE_ERR: Raised if <code>arg</code> is an <code>Attr</code> that is already an attribute of another <code>Element</code> object. The DOM user must explicitly clone <code>Attr</code> nodes to re-use them in other elements. <br>HIERARCHY_REQUEST_ERR: Raised if an attempt is made to add a node doesn't belong in this NamedNodeMap. Examples would include trying to insert something other than an Attr node into an Element's map of attributes, or a non-Entity node into the DocumentType's map of Entities. <br>NOT_SUPPORTED_ERR: Always thrown if the current document does not support the <code>"XML"</code> feature, since namespaces were defined by XML.<DT><B>Since: </B><DD>DOM Level 2</DD></DL></DD></DL><HR><A NAME="removeNamedItemNS(java.lang.String, java.lang.String)"><!-- --></A><H3>removeNamedItemNS</H3><PRE>public <A HREF="../../../org/w3c/dom/Node.html">Node</A> <B>removeNamedItemNS</B>(java.lang.String namespaceURI, java.lang.String localName) throws <A HREF="../../../org/w3c/dom/DOMException.html">DOMException</A></PRE><DL><DD>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 <code>Node</code> interface. If so, an attribute immediately appears containing the default value as well as the corresponding namespace URI, local name, and prefix when applicable. <br>Documents which do not support the "XML" feature will permit only the DOM Level 1 calls for creating/setting elements and attributes. Hence, if you specify a non-null namespace URI, these DOMs will never find a matching node.<DD><DL><DT><B>Parameters:</B><DD><CODE>namespaceURI</CODE> - The namespace URI of the node to remove.<DD><CODE>localName</CODE> - The local name of the node to remove.<DT><B>Returns:</B><DD>The node removed from this map if a node with such a local name and namespace URI exists.<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/w3c/dom/DOMException.html">DOMException</A></CODE> - NOT_FOUND_ERR: Raised if there is no node with the specified <code>namespaceURI</code> and <code>localName</code> in this map. <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.<DT><B>Since: </B><DD>DOM Level 2</DD></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/NamedNodeMap.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../org/w3c/dom/EntityReference.html"><B>PREV CLASS</B></A> <A HREF="../../../org/w3c/dom/Node.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="NamedNodeMap.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -