Name
NamedNodeMap.setNamedItemNS( ) — add a node to a NamedNodeMap using namespaces
Availability
DOM Level 2 Core
Synopsis
Node setNamedItemNS(Node arg
)
throws DOMException;
Arguments
-
arg
The node to be added to the NamedNodeMap.
Returns
The node that was replaced, or null
if no node was
replaced.
Throws
This method throws exceptions for the same reasons as
setNamedItem( )
. It may also throw a DOMException
with a code
of
NOT_SUPPORTED_ERR
if it is called in an
implementation that does not support XML documents or XML namespaces.
Description
This method works like setNamedItem( )
, except
that the node added to the NamedNodeMap can later be looked up by its
namespaceURI
and localName
properties instead of by its nodeName
property.
This method is useful only with XML documents that use namespaces.
Note that this method may be unsupported (i.e., may throw an
exception) in implementations that do not support XML documents.
Get JavaScript: The Definitive Guide, Fourth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.