copy.getAttributes().removeNamedItemNS("http://www.w3.org/2000/xmlns/","xml"); } catch (DOMException e) {} doc.appendChild(copy); copy.getAttributes().removeNamedItemNS("http://www.w3.org/2000/xmlns/","xml"); } catch (DOMException e) {} doc.appendChild(copy); copy.getAttributes().removeNamedItemNS("http://www.w3.org/2000/xmlns/","xml");
@Override public Node removeNamedItemNS(String namespaceURI, String localName) throws DOMException { return namedNodeMap.removeNamedItemNS(namespaceURI, localName); } }
void deleteMe() { if (dom instanceof Attr) { Attr attr = (Attr)this.dom; attr.getOwnerElement().getAttributes().removeNamedItemNS(attr.getNamespaceURI(), attr.getLocalName()); } else { if (this.dom.getParentNode() != null) { this.dom.getParentNode().removeChild(this.dom); } else { // This case can be exercised at least when executing the regression // tests under https://bugzilla.mozilla.org/show_bug.cgi?id=354145 } } }
void deleteMe() { if (dom instanceof Attr) { Attr attr = (Attr)this.dom; attr.getOwnerElement().getAttributes().removeNamedItemNS(attr.getNamespaceURI(), attr.getLocalName()); } else { if (this.dom.getParentNode() != null) { this.dom.getParentNode().removeChild(this.dom); } else { // This case can be exercised at least when executing the regression // tests under https://bugzilla.mozilla.org/show_bug.cgi?id=354145 } } }
/** * <b>DOM</b>: Implements {@link * org.w3c.dom.Element#removeAttributeNS(String,String)}. */ public void removeAttributeNS(String namespaceURI, String localName) throws DOMException { if (namespaceURI != null && namespaceURI.length() == 0) { namespaceURI = null; } if (!hasAttributeNS(namespaceURI, localName)) { return; } attributes.removeNamedItemNS(namespaceURI, localName); }
/** * <b>DOM</b>: Implements {@link * org.w3c.dom.Element#removeAttributeNS(String,String)}. */ public void removeAttributeNS(String namespaceURI, String localName) throws DOMException { if (namespaceURI != null && namespaceURI.length() == 0) { namespaceURI = null; } if (!hasAttributeNS(namespaceURI, localName)) { return; } attributes.removeNamedItemNS(namespaceURI, localName); }
/** * <b>DOM</b>: Implements {@link * org.w3c.dom.Element#removeAttributeNS(String,String)}. */ public void removeAttributeNS(String namespaceURI, String localName) throws DOMException { if (namespaceURI != null && namespaceURI.length() == 0) { namespaceURI = null; } if (!hasAttributeNS(namespaceURI, localName)) { return; } attributes.removeNamedItemNS(namespaceURI, localName); }
/** * Sets the text of this node. All the child's node are deleted and a new * child text node is created. * * @param n the <CODE>Node</CODE> to add the text to * @param text the text to add */ public void setNodeText(Node n, String text) { if (n == null) return; Node nc = null; while ((nc = n.getFirstChild()) != null) { n.removeChild(nc); } if (n.getAttributes().getNamedItemNS(XFA_DATA_SCHEMA, "dataNode") != null) n.getAttributes().removeNamedItemNS(XFA_DATA_SCHEMA, "dataNode"); n.appendChild(domDocument.createTextNode(text)); }
/** * Sets the text of this node. All the child's node are deleted and a new * child text node is created. * @param n the <CODE>Node</CODE> to add the text to * @param text the text to add */ public void setNodeText(Node n, String text) { if (n == null) return; Node nc = null; while ((nc = n.getFirstChild()) != null) { n.removeChild(nc); } if (n.getAttributes().getNamedItemNS(XFA_DATA_SCHEMA, "dataNode") != null) n.getAttributes().removeNamedItemNS(XFA_DATA_SCHEMA, "dataNode"); n.appendChild(domDocument.createTextNode(text)); changed = true; }
/** * Sets the text of this node. All the child's node are deleted and a new * child text node is created. * @param n the <CODE>Node</CODE> to add the text to * @param text the text to add */ public void setNodeText(Node n, String text) { if (n == null) return; Node nc = null; while ((nc = n.getFirstChild()) != null) { n.removeChild(nc); } if (n.getAttributes().getNamedItemNS(XFA_DATA_SCHEMA, "dataNode") != null) n.getAttributes().removeNamedItemNS(XFA_DATA_SCHEMA, "dataNode"); n.appendChild(domDocument.createTextNode(text)); changed = true; }
/** * Sets the text of this node. All the child's node are deleted and a new * child text node is created. * * @param n the <CODE>Node</CODE> to add the text to * @param text the text to add */ public void setNodeText(Node n, String text) { if (n == null) return; Node nc = null; while ((nc = n.getFirstChild()) != null) { n.removeChild(nc); } if (n.getAttributes().getNamedItemNS(XFA_DATA_SCHEMA, "dataNode") != null) n.getAttributes().removeNamedItemNS(XFA_DATA_SCHEMA, "dataNode"); n.appendChild(domDocument.createTextNode(text)); }
/** * Sets the text of this node. All the child's node are deleted and a new * child text node is created. * @param n the <CODE>Node</CODE> to add the text to * @param text the text to add */ public void setNodeText(Node n, String text) { if (n == null) return; Node nc = null; while ((nc = n.getFirstChild()) != null) { n.removeChild(nc); } if (n.getAttributes().getNamedItemNS(XFA_DATA_SCHEMA, "dataNode") != null) n.getAttributes().removeNamedItemNS(XFA_DATA_SCHEMA, "dataNode"); n.appendChild(domDocument.createTextNode(text)); changed = true; }
/** * Sets the text of this node. All the child's node are deleted and a new * child text node is created. * @param n the <CODE>Node</CODE> to add the text to * @param text the text to add */ public void setNodeText(Node n, String text) { if (n == null) return; Node nc = null; while ((nc = n.getFirstChild()) != null) { n.removeChild(nc); } if (n.getAttributes().getNamedItemNS(XFA_DATA_SCHEMA, "dataNode") != null) n.getAttributes().removeNamedItemNS(XFA_DATA_SCHEMA, "dataNode"); n.appendChild(domDocument.createTextNode(text)); changed = true; }
/** * Sets the text of this node. All the child's node are deleted and a new * child text node is created. * @param n the <CODE>Node</CODE> to add the text to * @param text the text to add */ public void setNodeText(Node n, String text) { if (n == null) return; Node nc = null; while ((nc = n.getFirstChild()) != null) { n.removeChild(nc); } if (n.getAttributes().getNamedItemNS(XFA_DATA_SCHEMA, "dataNode") != null) n.getAttributes().removeNamedItemNS(XFA_DATA_SCHEMA, "dataNode"); n.appendChild(domDocument.createTextNode(text)); changed = true; }
/** * <b>DOM</b>: Implements {@link * org.w3c.dom.Element#removeAttributeNode(Attr)}. */ public Attr removeAttributeNode(Attr oldAttr) throws DOMException { if (oldAttr == null) { return null; } if (attributes == null) { throw createDOMException(DOMException.NOT_FOUND_ERR, "attribute.missing", new Object[] { oldAttr.getName() }); } String nsURI = oldAttr.getNamespaceURI(); return (Attr)attributes.removeNamedItemNS(nsURI, (nsURI==null ? oldAttr.getNodeName() : oldAttr.getLocalName())); }
public DOMNode removeNamedItemNS(String namespaceURI, String localName) throws DOMException { try { return wrap(_delegate.removeNamedItemNS(namespaceURI, localName)); } catch (org.w3c.dom.DOMException ex) { throw wrap(ex); } }
/** * <b>DOM</b>: Implements {@link * org.w3c.dom.Element#removeAttributeNode(Attr)}. */ public Attr removeAttributeNode(Attr oldAttr) throws DOMException { if (oldAttr == null) { return null; } if (attributes == null) { throw createDOMException(DOMException.NOT_FOUND_ERR, "attribute.missing", new Object[] { oldAttr.getName() }); } String nsURI = oldAttr.getNamespaceURI(); return (Attr)attributes.removeNamedItemNS(nsURI, (nsURI==null ? oldAttr.getNodeName() : oldAttr.getLocalName())); }
/** * <b>DOM</b>: Implements {@link * org.w3c.dom.Element#removeAttributeNode(Attr)}. */ public Attr removeAttributeNode(Attr oldAttr) throws DOMException { if (oldAttr == null) { return null; } if (attributes == null) { throw createDOMException(DOMException.NOT_FOUND_ERR, "attribute.missing", new Object[] { oldAttr.getName() }); } String nsURI = oldAttr.getNamespaceURI(); return (Attr)attributes.removeNamedItemNS(nsURI, (nsURI==null ? oldAttr.getNodeName() : oldAttr.getLocalName())); }
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; NodeList elementList; Node testAddress; NamedNodeMap attributes; Attr newAttr; Node removedNode; doc = (Document) load("staffNS", true); elementList = doc.getElementsByTagName("address"); testAddress = elementList.item(1); attributes = testAddress.getAttributes(); removedNode = attributes.removeNamedItemNS("http://www.usa.com", "domestic"); assertNotNull("retval", removedNode); newAttr = (Attr) attributes.getNamedItem("dmstc:domestic"); assertNull("nodeRemoved", newAttr); } /**
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; NamedNodeMap attributes; Node element; Attr attribute; NodeList elementList; doc = (Document) load("staffNS", true); elementList = doc.getElementsByTagNameNS("http://www.nist.gov", "address"); element = elementList.item(1); attributes = element.getAttributes(); attribute = (Attr) attributes.removeNamedItemNS("http://www.nist.gov", "domestic"); attribute = (Attr) attributes.getNamedItemNS("http://www.nist.gov", "domestic"); assertNull("namednodemapremovenameditemns01", attribute); } /**