Package org.w3c.dom

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


      dbf.setNamespaceAware(true);

      DocumentBuilder db = dbf.newDocumentBuilder();
      Document doc = db.newDocument();
      Node df = doc.createDocumentFragment();

      return getDTM(new DOMSource(df), true, null, false, false);
    }
    catch (Exception e)
    {
View Full Code Here


        try {
            source = SourceUtil.getSource(location, typeParameters,
                                          parameters, resolver);
            Document doc = SourceUtil.toDOM(source);

            DocumentFragment fragment = doc.createDocumentFragment();
            fragment.appendChild(doc.getDocumentElement());

            return fragment;
        } catch (SourceException e) {
            throw SourceUtil.handle(e);
View Full Code Here

                            element = (Element)node;
                        } finally {
                            manager.release(xpathProcessor);
                        }
                    }
                    domTemplate = document.createDocumentFragment();
                    domTemplate.appendChild(element);
                } finally {
                    if (source != null) {
                        sourceResolver.release(source);
                    }
View Full Code Here

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

                docBuilder.setEntityResolver(entityResolver);

              Node xmlDoc = docBuilder.parse(new InputSource(inFileName));
              Document doc = docBuilder.newDocument();
              org.w3c.dom.DocumentFragment outNode =
                doc.createDocumentFragment();

              transformer.transform(new DOMSource(xmlDoc, inFileName),
                                    new DOMResult(outNode));

              // Now serialize output to disk with identity transformer
View Full Code Here

    if (!elname.equals(EndpointReference.SERVICE_REF_QNAME))
      throw new IllegalArgumentException("EPR root element "
          + elname + " should be " + EndpointReference.SERVICE_REF_QNAME);
   
    Document doc = DOMUtils.newDocument();
    DocumentFragment fragment = doc.createDocumentFragment();
    NodeList children = epr.getChildNodes();
    for (int i = 0 ; i < children.getLength(); ++i)
      fragment.appendChild(doc.importNode(children.item(i), true));
    ServiceEndpoint se = _ode.getContext().resolveEndpointReference(fragment);
    if (se == null)
View Full Code Here

  }
 

  public EndpointReference convertEndpoint(QName eprType, Element epr) {
      Document doc = DOMUtils.newDocument();
      DocumentFragment fragment = doc.createDocumentFragment();
      NodeList children = epr.getChildNodes();
      for (int i = 0 ; i < children.getLength(); ++i)
        fragment.appendChild(doc.importNode(children.item(i), true));
      ServiceEndpoint se = _ode.getContext().resolveEndpointReference(fragment);
      if (se == null)
View Full Code Here

        try {
           
            XMLStreamWriter origWriter = message.getContent(XMLStreamWriter.class);
            Document document = XMLUtils.newDocument();
            message.setContent(Node.class, document);
            W3CDOMStreamWriter writer = new W3CDOMStreamWriter(document.createDocumentFragment());
       
            // Replace stax writer with DomStreamWriter
            message.setContent(XMLStreamWriter.class, writer);       
            message.put(ORIGINAL_WRITER, origWriter);
           
View Full Code Here

                }

                if (source == null) {
                    try {
                        Document doc = DOMUtils.newDocument();
                        W3CDOMStreamWriter writer = new W3CDOMStreamWriter(doc.createDocumentFragment());
                        reader = message.getContent(XMLStreamReader.class);
                        //content must be an element thing, skip over any whitespace
                        StaxUtils.toNextTag(reader);
                        StaxUtils.copy(reader, writer, true);
                        doc.appendChild(DOMUtils.getFirstElement(writer.getCurrentFragment()));
View Full Code Here

                                         attributes.getValue(i));
                }
            }
            builder = new NodeBuilder(doc, element);
        } else {
            builder = new NodeBuilder(doc, doc.createDocumentFragment());
        }
        xmlReader.setContentHandler(builder);

    }
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.