@Override public Node setNamedItemNS(Node arg) throws DOMException { return namedNodeMap.setNamedItemNS(arg); }
/** * <b>DOM</b>: Implements {@link * org.w3c.dom.Element#setAttributeNode(Attr)}. */ public Attr setAttributeNode(Attr newAttr) throws DOMException { if (newAttr == null) { return null; } if (attributes == null) { attributes = createAttributes(); } return (Attr)attributes.setNamedItemNS(newAttr); }
/** * <b>DOM</b>: Implements {@link * org.w3c.dom.Element#setAttributeNodeNS(Attr)}. */ public Attr setAttributeNodeNS(Attr newAttr) throws DOMException { if (newAttr == null) { return null; } if (attributes == null) { attributes = createAttributes(); } return (Attr)attributes.setNamedItemNS(newAttr); }
/** * <b>DOM</b>: Implements {@link * org.w3c.dom.Element#setAttributeNodeNS(Attr)}. */ public Attr setAttributeNodeNS(Attr newAttr) throws DOMException { if (newAttr == null) { return null; } if (attributes == null) { attributes = createAttributes(); } return (Attr)attributes.setNamedItemNS(newAttr); }
/** * <b>DOM</b>: Implements {@link * org.w3c.dom.Element#setAttributeNode(Attr)}. */ public Attr setAttributeNode(Attr newAttr) throws DOMException { if (newAttr == null) { return null; } if (attributes == null) { attributes = createAttributes(); } return (Attr)attributes.setNamedItemNS(newAttr); }
/** * <b>DOM</b>: Implements {@link * org.w3c.dom.Element#setAttributeNode(Attr)}. */ public Attr setAttributeNode(Attr newAttr) throws DOMException { if (newAttr == null) { return null; } if (attributes == null) { attributes = createAttributes(); } return (Attr)attributes.setNamedItemNS(newAttr); }
/** * <b>DOM</b>: Implements {@link * org.w3c.dom.Element#setAttributeNodeNS(Attr)}. */ public Attr setAttributeNodeNS(Attr newAttr) throws DOMException { if (newAttr == null) { return null; } if (attributes == null) { attributes = createAttributes(); } return (Attr)attributes.setNamedItemNS(newAttr); }
protected void runTest() throws Throwable { DocumentBuilder db = dbf.newDocumentBuilder(); Document document1 = db.newDocument(); Document document2 = db.newDocument(); Element element = document1.createElementNS(null, "test"); Attr attr = document2.createAttributeNS(null, "test"); try { element.getAttributes().setNamedItemNS(attr); fail("Expected DOMException"); } catch (DOMException ex) { assertEquals(DOMException.WRONG_DOCUMENT_ERR, ex.code); } } }
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { String namespaceURI = "http://www.usa.com"; String qualifiedName = "dmstc:domestic"; Document doc; Node arg; NodeList elementList; Node testAddress; NamedNodeMap attributes; Node retnode; String value; doc = (Document) load("staffNS", true); arg = doc.createAttributeNS(namespaceURI, qualifiedName); arg.setNodeValue("newValue"); elementList = doc.getElementsByTagName("address"); testAddress = elementList.item(0); attributes = testAddress.getAttributes(); retnode = attributes.setNamedItemNS(arg); value = retnode.getNodeValue(); assertEquals("throw_Equals", "Yes", value); } /**
/** * <b>DOM</b>: Implements {@link * org.w3c.dom.Element#setAttributeNS(String,String,String)}. */ public void setAttributeNS(String namespaceURI, String qualifiedName, String value) throws DOMException { if (attributes == null) { attributes = createAttributes(); } if (namespaceURI != null && namespaceURI.length() == 0) { namespaceURI = null; } Attr attr = getAttributeNodeNS(namespaceURI, qualifiedName); if (attr == null) { attr = getOwnerDocument().createAttributeNS(namespaceURI, qualifiedName); attr.setValue(value); attributes.setNamedItemNS(attr); } else { attr.setValue(value); } }
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { String namespaceURI = "http://www.nist.gov"; String qualifiedName = "prefix:newAttr"; Document doc; Node arg; NodeList elementList; Node testAddress; NamedNodeMap attributes; Node retnode; String value; Node setNode; doc = (Document) load("staffNS", true); arg = doc.createAttributeNS(namespaceURI, qualifiedName); arg.setNodeValue("newValue"); elementList = doc.getElementsByTagName("address"); testAddress = elementList.item(0); attributes = testAddress.getAttributes(); setNode = attributes.setNamedItemNS(arg); retnode = attributes.getNamedItemNS(namespaceURI, "newAttr"); value = retnode.getNodeValue(); assertEquals("throw_Equals", "newValue", value); } /**
/** * <b>DOM</b>: Implements {@link * org.w3c.dom.Element#setAttributeNS(String,String,String)}. */ public void setAttributeNS(String namespaceURI, String qualifiedName, String value) throws DOMException { if (attributes == null) { attributes = createAttributes(); } if (namespaceURI != null && namespaceURI.length() == 0) { namespaceURI = null; } Attr attr = getAttributeNodeNS(namespaceURI, qualifiedName); if (attr == null) { attr = getOwnerDocument().createAttributeNS(namespaceURI, qualifiedName); attr.setValue(value); attributes.setNamedItemNS(attr); } else { attr.setValue(value); } }
/** * <b>DOM</b>: Implements {@link * org.w3c.dom.Element#setAttributeNS(String,String,String)}. */ public void setAttributeNS(String namespaceURI, String qualifiedName, String value) throws DOMException { if (attributes == null) { attributes = createAttributes(); } if (namespaceURI != null && namespaceURI.length() == 0) { namespaceURI = null; } Attr attr = getAttributeNodeNS(namespaceURI, qualifiedName); if (attr == null) { attr = getOwnerDocument().createAttributeNS(namespaceURI, qualifiedName); attr.setValue(value); attributes.setNamedItemNS(attr); } else { attr.setValue(value); } }
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; NamedNodeMap attributes; NodeList elementList; Element element; Attr attr; Node newNode; doc = (Document) load("staffNS", true); elementList = doc.getElementsByTagNameNS("*", "address"); element = (Element) elementList.item(0); attributes = element.getAttributes(); attr = (Attr) attributes.getNamedItemNS("http://www.usa.com", "domestic"); element = (Element) elementList.item(1); attributes = element.getAttributes(); { boolean success = false; try { newNode = attributes.setNamedItemNS(attr); } catch (DOMException ex) { success = (ex.code == DOMException.INUSE_ATTRIBUTE_ERR); } assertTrue("namednodemapsetnameditemns06", success); } } /**
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; NamedNodeMap attributes; NodeList elementList; Element element; Attr attr; Node newNode; doc = (Document) load("staffNS", true); elementList = doc.getElementsByTagNameNS("*", "address"); element = (Element) elementList.item(0); attributes = element.getAttributes(); attr = (Attr) attributes.getNamedItemNS("http://www.usa.com", "domestic"); element = (Element) elementList.item(1); attributes = element.getAttributes(); { boolean success = false; try { newNode = attributes.setNamedItemNS(attr); } catch (DOMException ex) { success = (ex.code == DOMException.INUSE_ATTRIBUTE_ERR); } assertTrue("namednodemapsetnameditemns07", success); } } /**
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; NamedNodeMap attributes; NodeList elementList; Element element; Attr attr; Node newNode; doc = (Document) load("staffNS", true); elementList = doc.getElementsByTagNameNS("*", "address"); element = (Element) elementList.item(0); attributes = element.getAttributes(); attr = (Attr) attributes.getNamedItemNS("http://www.usa.com", "domestic"); element = (Element) elementList.item(1); attributes = element.getAttributes(); { boolean success = false; try { newNode = attributes.setNamedItemNS(attr); } catch (DOMException ex) { success = (ex.code == DOMException.INUSE_ATTRIBUTE_ERR); } assertTrue("namednodemapsetnameditemns08", success); } } /**
public DOMNode setNamedItemNS(DOMNode arg) throws DOMException { try { return wrap(_delegate.setNamedItemNS(arg.getDelegate())); } catch (org.w3c.dom.DOMException ex) { throw wrap(ex); } } }
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; NamedNodeMap attributes; Element element; Attr attribute; Attr attribute1; Node newNode; String attrName; doc = (Document) load("staffNS", true); element = doc.createElementNS("http://www.w3.org/DOM/Test", "root"); attribute1 = doc.createAttributeNS("http://www.w3.org/DOM/L1", "L1:att"); attributes = element.getAttributes(); newNode = attributes.setNamedItemNS(attribute1); attribute = (Attr) attributes.getNamedItemNS("http://www.w3.org/DOM/L1", "att"); attrName = attribute.getNodeName(); assertEquals("namednodemapsetnameditemns02", "L1:att", attrName); } /**
domAttributes.setNamedItemNS(attr); } else { Attr attr = doc.createAttribute(qname);
newNode = entities.setNamedItemNS(attr); } catch (DOMException ex) { success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR); newNode = notations.setNamedItemNS(attr); } catch (DOMException ex) { success = (ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR);