Examples of StreamResult


Examples of javax.xml.transform.stream.StreamResult

        Properties props = new Properties();
        //props.setProperty(OutputKeys.METHOD, "text");
        props.setProperty(SaxonOutputKeys.WRAP, "no");
        props.setProperty(OutputKeys.INDENT, "no");
        props.setProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
        exp.run(dynamicContext, new StreamResult(res_sw), props);
        String swresult = sw.toString();
        long used = SystemUtils.getHeapUsedMemory();
        stdbuf.append(", used(before GC): " + StringUtils.displayBytesSize(used));
        if(RUN_ONLY) {
            res_sw.close();
View Full Code Here

Examples of javax.xml.transform.stream.StreamResult

        Properties props = new Properties();
        //props.setProperty(OutputKeys.METHOD, "text");
        props.setProperty(SaxonOutputKeys.WRAP, "no");
        props.setProperty(OutputKeys.INDENT, "no");
        props.setProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
        exp.run(dynamicContext, new StreamResult(res_sw), props);
        String swresult = sw.toString();
        long used = SystemUtils.getHeapUsedMemory();
        stdbuf.append(", used(before GC): " + StringUtils.displayBytesSize(used));
        System.gc();
        used = SystemUtils.getHeapUsedMemory();
View Full Code Here

Examples of javax.xml.transform.stream.StreamResult

        TransformerFactory factory = TransformerFactory.newInstance();
        FileOutputStream fos = new FileOutputStream(target.toString());
        javax.xml.transform.Transformer transformer =
                              factory.newTransformer(new StreamSource(template.toString()));
        transformer.transform(new StreamSource(source.toString()),
                              new StreamResult(fos));
       
        fos.close();
    }
View Full Code Here

Examples of javax.xml.transform.stream.StreamResult

        TransformerFactory.newInstance().newTransformer(
                new StreamSource(new File("src/com/hp/hpl/jena/iri/impl/viol2java.xsl"))
                );
        xsl.transform(
                new StreamSource(new File("src/com/hp/hpl/jena/iri/impl/violations.xml")),
                new StreamResult(new File("src/com/hp/hpl/jena/iri/ViolationCodes.java"))
                       
        );
       
       
       
View Full Code Here

Examples of javax.xml.transform.stream.StreamResult

                        List contents = doc.getContent();
                        if (contents != null) {
                            for (Iterator iter = contents.iterator(); iter.hasNext();) {
                                Node node = (Node)iter.next();
                                DOMSource source = new DOMSource(node);
                                StreamResult result = new StreamResult(writer);
                                try {
                                    s_transformer.transform(source, result);
                                } catch (TransformerException e) {
                                    s_logger.error("Failed documentation output transformation", e);
                                }
View Full Code Here

Examples of javax.xml.transform.stream.StreamResult

      if (outputFile.exists() && outputFile.lastModified() >= sourceFile.lastModified())
        continue;

      log.debug("transforming help file to [" + outputFile.getPath() + "]");
      StreamResult result = new StreamResult(outputFile);

      try {
        transformer.transform(new DOMSource(document), result);
      } catch (Exception e) {
        throw new HelpException("Error during the transformation of [" + xmlFile + "]", e);
View Full Code Here

Examples of javax.xml.transform.stream.StreamResult

      sqlMapElem.item(0).appendChild(elem);
     
      Transformer trans = TransformerFactory.newInstance().newTransformer();
      File tempFile = File.createTempFile("sqlMapConfig", ".xml");
      tempFile.deleteOnExit();
      trans.transform(new DOMSource(doc),new StreamResult(tempFile));
     
      //从临时的配置文件中初始化sqlMapClient
      input = new FileInputStream(tempFile);
      SqlMapClientHolder.sqlMapClient = SqlMapClientBuilder
          .buildSqlMapClient(input);
View Full Code Here

Examples of javax.xml.transform.stream.StreamResult

                        FileOutputStream out = new FileOutputStream(name);
                        Transformer transformer =
                            TransformerFactory.newInstance().newTransformer();
                        transformer.setOutputProperty("indent", "no");
                        DOMSource source = new DOMSource(schema);
                        Result result = new StreamResult(out);
                        transformer.transform(source, result);
                        out.close();
                        System.out.print("Wrote schema " + name);
                        if (tns.length() == 0) {
                            System.out.println(" for default namespace");
View Full Code Here

Examples of javax.xml.transform.stream.StreamResult

        StringWriter res_sw = new StringWriter();
        Properties props = new Properties();
        props.setProperty(SaxonOutputKeys.WRAP, "no");
        props.setProperty(OutputKeys.INDENT, "no");
        props.setProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
        exp.run(dynamicContext, new StreamResult(res_sw), props);
        return res_sw.toString();
    }
View Full Code Here

Examples of javax.xml.transform.stream.StreamResult

    try {
      transformer = tFactory.newTransformer(new StreamSource(xslDocUri));
//      transformer = tFactory.newTransformer(new StreamSource(new ByteArrayInputStream(xslDoc.getBytes())));
      transformer.transform(
        new StreamSource(new ByteArrayInputStream(xmlDoc)),
        new StreamResult(outputURL));
    }
    catch (Exception e) {
      throw new IOException(e.getMessage());
    }
  }
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.