示例#1
0
 public SOAPElement addAttribute(QName qname, String value) throws SOAPException {
   addAttributeBare(qname, value);
   if (!"".equals(qname.getNamespaceURI())) {
     ensureNamespaceIsDeclared(qname.getPrefix(), qname.getNamespaceURI());
   }
   return this;
 }
示例#2
0
  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;
  }
示例#3
0
 private void addAttributeBare(QName name, String value) {
   addAttributeBare(name.getNamespaceURI(), name.getPrefix(), getQualifiedName(name), value);
 }
示例#4
0
 private void addAttributeBare(Name name, String value) {
   addAttributeBare(name.getURI(), name.getPrefix(), name.getQualifiedName(), value);
 }