throw new DomEx(DomEx.NAMESPACE_ERR,
throw new DomDOMException(DOMException.NAMESPACE_ERR,
  public Node renameNode(Node n, String namespaceURI, String qualifiedName)    throws DOMException  {    if (n instanceof DomNsNode)      {        DomNsNode src = (DomNsNode) n;        if (src == null)          {            throw new DomEx(DomEx.NOT_FOUND_ERR);          }        if (src.owner != this)          {            throw new DomEx(DomEx.WRONG_DOCUMENT_ERR, null, src, 0);          }        boolean xml11 = "1.1".equals(version);        checkName(qualifiedName, xml11);        int ci = qualifiedName.indexOf(':');        if ("".equals(namespaceURI))          {            namespaceURI = null;          }        if (namespaceURI != null)          {            checkNCName(qualifiedName, xml11);            String prefix = (ci == -1) ? "" :              qualifiedName.substring(0, ci);            if (XMLConstants.XML_NS_PREFIX.equals(prefix) &&                !XMLConstants.XML_NS_URI.equals(namespaceURI))              {                throw new DomEx(DomEx.NAMESPACE_ERR,                                "xml namespace must be " +                                XMLConstants.XML_NS_URI, src, 0);              }            else if (src.nodeType == ATTRIBUTE_NODE &&                     (XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) ||                      XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName)) &&                     !XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI))              {                throw new DomEx(DomEx.NAMESPACE_ERR,                                "xmlns namespace must be " +                                XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0);              }            if (XMLConstants.XML_NS_URI.equals(namespaceURI) &&                !XMLConstants.XML_NS_PREFIX.equals(prefix))              {                throw new DomEx(DomEx.NAMESPACE_ERR,                                "xml namespace must be " +                                XMLConstants.XML_NS_URI, src, 0);              }            else if (src.nodeType == ATTRIBUTE_NODE &&                     XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI) &&                     !(XMLConstants.XMLNS_ATTRIBUTE.equals(prefix) ||                       XMLConstants.XMLNS_ATTRIBUTE.equals(qualifiedName)))              {                throw new DomEx(DomEx.NAMESPACE_ERR,                                "xmlns namespace must be " +                                XMLConstants.XMLNS_ATTRIBUTE_NS_URI, src, 0);              }                          }        src.setNodeName(qualifiedName);        src.setNamespaceURI(namespaceURI);        src.notifyUserDataHandlers(UserDataHandler.NODE_RENAMED, src, src);        // TODO MutationNameEvents        // DOMElementNameChanged or DOMAttributeNameChanged        return src;      }    throw new DomEx(DomEx.NOT_SUPPORTED_ERR, null, n, 0);  }