public SOAPElement addAttribute(QName qname, String value) throws SOAPException { addAttributeBare(qname, value); if (!"".equals(qname.getNamespaceURI())) { ensureNamespaceIsDeclared(qname.getPrefix(), qname.getNamespaceURI()); } return this; }
protected static SOAPElement replaceElementWithSOAPElement(Element element, ElementImpl copy) { Iterator eachAttribute = getAllAttributesFrom(element); while (eachAttribute.hasNext()) { Name name = (Name) eachAttribute.next(); copy.addAttributeBare(name, getAttributeValueFrom(element, name)); } Iterator eachChild = getChildElementsFrom(element); while (eachChild.hasNext()) { Node nextChild = (Node) eachChild.next(); copy.insertBefore(nextChild, null); } Node parent = element.getParentNode(); if (parent != null) { parent.replaceChild(copy, element); } // XXX else throw an exception? return copy; }
private void addAttributeBare(QName name, String value) { addAttributeBare(name.getNamespaceURI(), name.getPrefix(), getQualifiedName(name), value); }
private void addAttributeBare(Name name, String value) { addAttributeBare(name.getURI(), name.getPrefix(), name.getQualifiedName(), value); }