Package org.w3c.dom

Examples of org.w3c.dom.Document.createDocumentFragment()


    public DocumentFragment getAsReference(QName operationName) {
        try {
            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            dbf.setNamespaceAware(true);
            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;
View Full Code Here


        }
    }
   
    public DocumentFragment createHeader(QName name, SoapVersion soapVersion) {
        Document doc = DomUtil.createDocument();
        DocumentFragment df = doc.createDocumentFragment();
        Element e = DomUtil.createElement(df, name);
        e.setAttributeNS(soapVersion.getNamespace(),
                         soapVersion.getPrefix() + ":" + soapVersion.getAttrNameMustUnderstand(),
                         "true");
        return df;
View Full Code Here

                "ConsumerReference");
        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

        return DOMUtil.getElementText(el);
    }
   
    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;
    }
View Full Code Here

    while (reader.nextTag() != XMLStreamConstants.END_ELEMENT) {
      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);
    }
  }
View Full Code Here

            throw new ProcessingException("Transforming exception during selectSingleNode with path: '"+path+"'. Exception: " + localException, localException);
        }

        if (list != null && list.getLength() > 0) {
            Document doc = XMLUtil.createDocument();
            result = doc.createDocumentFragment();

            for(int i = 0; i < list.getLength(); i++) {

                // the found node is either an attribute or an element
                if (list.item(i).getNodeType() == Node.ATTRIBUTE_NODE) {
View Full Code Here

        builder.endElement("", "sunShine", "sunShine");
        builder.endDocument();

        // Create Document Fragment
        final Document doc = builder.getDocument();
        final DocumentFragment recordedDocFrag = doc.createDocumentFragment();
        final Node root = doc.getDocumentElement();
        root.normalize();
        Node child;
        boolean appendedNode = false;
        while (root.hasChildNodes() == true) {
View Full Code Here

        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("layout base profile loaded");
        }
        // now create the base profile containing the above profiles
        profileDoc = XMLUtil.createDocument();
        profile = profileDoc.createDocumentFragment();
        profileRoot = profileDoc.createElementNS(null, "profile");
        profile.appendChild(profileRoot);
        profileRoot.appendChild(profileDoc.importNode(XMLUtil.selectSingleNode(layoutFragment,
                                                                  "layout-profile"), true));
        profileRoot.appendChild(profileDoc.importNode(XMLUtil.selectSingleNode(sunletsFragment,
View Full Code Here

        if (path.startsWith("/") == true) path = path.substring(1);
        NodeList list = null;

        if (path == null || path.equals("") == true) {
            Document doc = XMLUtil.createDocument();
            result = doc.createDocumentFragment();
            this.getLayoutDOM();
            if (this.layoutDOM != null) {
                result.appendChild(doc.importNode(this.layoutDOM.getDocumentElement(), true));
            }
            if (this.configurationDOM != null) {
View Full Code Here

            }
        }

        if (list != null && list.getLength() > 0) {
            Document doc = XMLUtil.createDocument();
            result = doc.createDocumentFragment();

            for(int i = 0; i < list.getLength(); i++) {

                // the found node is either an attribute or an element
                if (list.item(i).getNodeType() == Node.ATTRIBUTE_NODE) {
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.