Package org.w3c.dom

Examples of org.w3c.dom.DocumentFragment.appendChild()


        Document document = dbf.newDocumentBuilder().newDocument();
       
        DocumentFragment fragment = document.createDocumentFragment();
        Element x = document.createElementNS(null, "x");
        Element y = document.createElementNS(null, "y");
        fragment.appendChild(x);
        fragment.appendChild(y);
       
        Element element = document.createElementNS(null, "parent");
        Element a = document.createElementNS(null, "a");
        Element b = document.createElementNS(null, "b");
View Full Code Here


       
        DocumentFragment fragment = document.createDocumentFragment();
        Element x = document.createElementNS(null, "x");
        Element y = document.createElementNS(null, "y");
        fragment.appendChild(x);
        fragment.appendChild(y);
       
        Element element = document.createElementNS(null, "parent");
        Element a = document.createElementNS(null, "a");
        Element b = document.createElementNS(null, "b");
        element.appendChild(a);
View Full Code Here

        Document myDoc = db.newDocument();
       
        Text textNode = myDoc.createTextNode(textNodeValue);
        DocumentFragment docFrag = myDoc.createDocumentFragment();
 
        docFrag.appendChild(textNode);
 
        return new NodeSet(docFrag);
      }
      catch(ParserConfigurationException pce)
      {
View Full Code Here

                    DocumentFragment df = headers.get(hn);
                    if (df == null) {
                        df = e.getOwnerDocument().createDocumentFragment();
                    }
                    e = (Element) df.getOwnerDocument().importNode(e, true);
                    df.appendChild(e);
                    headers.put(hn, df);
                }
                xmlReader.nextTag();
            }
            if (!xmlReader.getName().equals(soapVersion.getBody())) {
View Full Code Here

                QName headerName = part.getElement();
                if (!headerName.equals(DomUtil.getQName(e))) {
                    throw new Fault("Header part '" + part.getName() + "' element '" + DomUtil.getQName(e) + " doesn't match expected element '" + QNameUtil.toString(headerName) + "'");
                }
                for (int j=0; j<nodes.getLength(); j++) {
                    frag.appendChild(document.importNode(nodes.item(j), true));
                }
                message.getSoapHeaders().put(headerName, frag);
            }
        }
        message.setContent(Source.class, new DOMSource(document));
View Full Code Here

            Document doc = dbf.newDocumentBuilder().newDocument();
            DocumentFragment df = doc.createDocumentFragment();
            Element e = doc.createElementNS(eprElement.getNamespaceURI(), eprElement.getLocalPart());
            Text t = doc.createTextNode(locationUri);
            e.appendChild(t);
            df.appendChild(e);
            return df;
        } catch (Exception e) {
            throw new RuntimeException("Could not create reference", e);
        }
    }
View Full Code Here

        if (nl.getLength() != 1) {
            throw new Exception("Subscribe request must have exactly one ConsumerReference node");
        }
        Element el = (Element) nl.item(0);
        DocumentFragment epr = doc.createDocumentFragment();
        epr.appendChild(el);
        ServiceEndpoint ep = getContext().resolveEndpointReference(epr);
        if (ep == null) {
            String[] parts = split(subscribeRequest.getConsumerReference().getAddress().getValue().trim());
            ep = getContext().getEndpoint(new QName(parts[0], parts[1]), parts[2]);
        }
View Full Code Here

    protected DocumentFragment createHeader(QName name, String value) throws Exception {
        Document doc = new SourceTransformer().createDocument();
        DocumentFragment df = doc.createDocumentFragment();
        Element el = doc.createElementNS(name.getNamespaceURI(), getQualifiedName(name));
        el.appendChild(doc.createTextNode(value));
        df.appendChild(el);
        return df;
    }
   
    /**
     * Gets the QName prefix.  If the QName has no set prefix, the specified default prefix will be used.
View Full Code Here

    private void parseHeaders(SoapMessage message, Element headers) {
        for (Element child = DOMUtil.getFirstChildElement(headers);
             child != null;
             child = DOMUtil.getNextSiblingElement(child)) {
            DocumentFragment df = child.getOwnerDocument().createDocumentFragment();
            df.appendChild(child.cloneNode(true));
            message.addHeader(DOMUtil.getQName(child), df);
        }
    }
   
  private SoapMessage readSoapUsingStax(InputStream is) throws Exception {
View Full Code Here

      QName hn = reader.getName();
      FragmentStreamReader rh = new FragmentStreamReader(reader);
      Document doc = (Document) marshaler.getSourceTransformer().toDOMNode(
          new StaxSource(rh));
      DocumentFragment df = doc.createDocumentFragment();
      df.appendChild(doc.getDocumentElement());
      message.addHeader(hn, df);
    }
  }

  public SoapMessage read(MimeMessage mime) throws Exception {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.