Package org.dom4j.io

Examples of org.dom4j.io.DocumentSource


           
            final org.dom4j.Document profileDocument = new org.dom4j.DocumentFactory().createDocument();
            profileDocument.setRootElement((org.dom4j.Element)profileElement);
            profileDocument.setName(ownerUsername + ".profile");
           
            final DocumentSource profileSource = new DocumentSource(profileElement);
            this.portalDataHandlerService.importData(profileSource);
        }
      

        final IPerson person = new PersonImpl();
View Full Code Here


   */
  public String applyTemplate(String xml, InputStream template, String url) {
    try {
      final TransformerFactory factory = TransformerFactory.newInstance();
      final Transformer transformer = factory.newTransformer(new StreamSource(template));
      final DocumentSource source = new DocumentSource(DocumentHelper.parseText(xml));
      final StringWriter sw = new StringWriter();
      final StreamResult response = new StreamResult(sw);
      transformer.setParameter("url", url);
      transformer.transform(source, response);

View Full Code Here

        transformer = factory
            .newTransformer( new StreamSource( ApacheDSConfigurationPlugin.class.getResourceAsStream( "template.xslt" ) ) );

        // now lets style the given document
        DocumentSource source = new DocumentSource( document );
        DocumentResult result = new DocumentResult();

        transformer.transform( source, result );

        // return the transformed document
View Full Code Here

            // TODO Auto-generated catch block
            e1.printStackTrace();
        }

        // now lets style the given document
        DocumentSource source = new DocumentSource( document );
        DocumentResult result = new DocumentResult();
        try
        {
            transformer.transform( source, result );
        }
View Full Code Here

        {
            // Will never occur
        }

        // now lets style the given document
        DocumentSource source = new DocumentSource( document );
        DocumentResult result = new DocumentResult();
        try
        {
            transformer.transform( source, result );
        }
View Full Code Here

       
        TransformerFactory transformerFactory = TransformerFactory.newInstance();
        Transformer transformer = transformerFactory.newTransformer(new StreamSource(xsl));
        transformer.setParameter("tempDir", aTempDir);

        Source xmlSource = new DocumentSource(doc);
   
        Result outputTarget = new StreamResult(out); //new FileWriter(outFile));
       
        log.debug("starting bytestream transformation ...");
        transformer.transform(xmlSource, outputTarget);
View Full Code Here

    org.dom4j.Document nexmlDocument = reader.read( new ByteArrayInputStream(input.getBytes()) );
           
    DocumentResult cdaoResult = new DocumentResult();
   
    Transformer cdaoTransformer = TransformerFactory.newInstance().newTransformer( new StreamSource( "http://www.nexml.org/nexml/xslt/nexml2cdao.xsl"  ) );   
    cdaoTransformer.transform( new DocumentSource( nexmlDocument ), cdaoResult );
       
    org.dom4j.Document cdaoDoc = cdaoResult.getDocument();
    return cdaoDoc.asXML();   
  }
View Full Code Here

            Transformer transformer = factory.newTransformer(new StreamSource(
                    xslFile));

            long start = System.currentTimeMillis();
            for (ii = 0; ii < kk; ii++) {
                Source source = new DocumentSource(xmlDoc);
                DocumentResult result = new DocumentResult();
                transformer.transform(source, result);

                // output the transformed document
            }
View Full Code Here

            Transformer transformer = factory.newTransformer(new StreamSource(
                    xslFile));

            long start = System.currentTimeMillis();
            for (ii = 0; ii < kk; ii++) {
                Source source = new DocumentSource(xmlDoc);
                DocumentResult result = new DocumentResult();
                transformer.transform(source, result);

                // output the transformed document
            }
View Full Code Here

        TransformerFactory factory = TransformerFactory.newInstance();
        Transformer transformer = factory.newTransformer(new StreamSource(xsl));

        // now lets create the TrAX source and result
        // objects and do the transformation
        Source source = new DocumentSource(document);
        DocumentResult result = new DocumentResult();
        transformer.transform(source, result);

        // output the transformed document
        Document transformedDoc = result.getDocument();
View Full Code Here

TOP

Related Classes of org.dom4j.io.DocumentSource

Copyright © 2018 www.massapicom. 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.