Exemple #1
0
  protected SOAPElement createElement(Name name) {

    if (isNamespaceQualified(name)) {
      return (SOAPElement)
          getOwnerDocument().createElementNS(name.getURI(), name.getQualifiedName());
    } else {
      return (SOAPElement) getOwnerDocument().createElement(name.getQualifiedName());
    }
  }
 public static void copyAttributes(Element target, SOAPElement source) {
   // easy way out: no attributes to copy
   if (!source.hasAttributes()) return;
   final boolean traceEnabled = log.isTraceEnabled();
   // traverse attributes
   Iterator attrNameIt = source.getAllAttributes();
   while (attrNameIt.hasNext()) {
     Name attrName = (Name) attrNameIt.next();
     String namespaceURI = attrName.getURI();
     String value = source.getAttributeValue(attrName);
     if (StringUtils.isEmpty(namespaceURI)) {
       String localName = attrName.getLocalName();
       target.setAttribute(localName, value);
       if (traceEnabled) log.trace("set attribute: " + localName);
     } else {
       String qualifiedName = attrName.getQualifiedName();
       target.setAttributeNS(namespaceURI, qualifiedName, value);
       if (traceEnabled) log.trace("set attribute: " + qualifiedName);
     }
   }
 }
Exemple #3
0
 protected static String getAttributeValueFrom(Element element, Name name) {
   return getAttributeValueFrom(
       element, name.getURI(), name.getLocalName(), name.getPrefix(), name.getQualifiedName());
 }
Exemple #4
0
 public ElementImpl(SOAPDocumentImpl ownerDoc, Name name) {
   super(ownerDoc, name.getURI(), name.getQualifiedName(), name.getLocalName());
   elementQName = NameImpl.convertToQName(name);
 }
Exemple #5
0
 private void addAttributeBare(Name name, String value) {
   addAttributeBare(name.getURI(), name.getPrefix(), name.getQualifiedName(), value);
 }