Examples of newTransformer()


Examples of com.dotcms.repackage.javax.xml.transform.TransformerFactory.newTransformer()

        Source xsltSource = new StreamSource(new InputStreamReader(new FileInputStream(binFile), "UTF8"));

        // create an instance of TransformerFactory
        TransformerFactory transFact = TransformerFactory.newInstance();
        StreamResult result = new StreamResult(new ByteArrayOutputStream());
        Transformer trans = transFact.newTransformer(xsltSource);

        try{
          trans.transform(xmlSource, result);
        }catch(Exception e1){
          Logger.error(XsltTool.class, "Error in transformation. "+e1.getMessage());
View Full Code Here

Examples of com.icl.saxon.TransformerFactoryImpl.newTransformer()

      URL url = getStylesheetURL();
      try {
        TransformerFactory transformerFactory = new TransformerFactoryImpl();
        transformerFactory.setURIResolver(uriResolver);
        Source source = new StreamSource(url.openStream(), url.toExternalForm());
        Transformer transformer = transformerFactory.newTransformer(source);

        if (!isShowXslMessages()) {
          Controller controller = (Controller) transformer;
          try {
            controller.makeMessageEmitter();
View Full Code Here

Examples of javax.xml.transform.Templates.newTransformer()

    ByteArrayOutputStream oOutputStream = new ByteArrayOutputStream();

    TransformerFactory oFactory = TransformerFactory.newInstance();
    StreamSource oStreamSrc = new StreamSource(oStyleSheetStream);
    Templates oTemplates = oFactory.newTemplates(oStreamSrc);
    Transformer oTransformer = oTemplates.newTransformer();

    if (null!=oProps) setParameters(oTransformer, oProps);
    StreamSource oStreamSrcXML = new StreamSource(oXMLInputStream);
    StreamResult oStreamResult = new StreamResult(oOutputStream);
    if (DebugFile.trace) DebugFile.writeln("Transformer.transform(StreamSource,StreamResult)");
View Full Code Here

Examples of javax.xml.transform.Templates.newTransformer()

        of transformation instructions, without penalizing runtime
        transformation.
      */
      Templates templates = transformerFactory.newTemplates( template );

      Transformer transformer = templates.newTransformer();
      if( outputProps != null )
      {
         transformer.setOutputProperties( outputProps );
      }

View Full Code Here

Examples of javax.xml.transform.Templates.newTransformer()

      StreamSource template = new StreamSource( templateIs );

      Templates templates = transformerFactory.newTemplates( template );

      // set output properties
      Transformer transformer = templates.newTransformer();
      if(outputProps != null)
      {
         transformer.setOutputProperties(outputProps);
      }
View Full Code Here

Examples of javax.xml.transform.Templates.newTransformer()

        TransformerFactory tf = TransformerFactory.newInstance();

        StreamSource source = new StreamSource(xsl);
        Templates templates = tf.newTemplates(source);

        Transformer trf = templates.newTransformer();

        trf.transform(new StreamSource(input), new StreamResult(output));
    }
}
View Full Code Here

Examples of javax.xml.transform.TransformerFactory.newTransformer()

  public static String prettyPrint(SQLXML xml) throws SQLException {
    try {
      TransformerFactory transFactory = TransformerFactory.newInstance();
      transFactory.setAttribute("indent-number", new Integer(2)); //$NON-NLS-1$
     
      Transformer tf = transFactory.newTransformer();
      tf.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); //$NON-NLS-1$
      tf.setOutputProperty(OutputKeys.ENCODING, "UTF-8");//$NON-NLS-1$
      tf.setOutputProperty(OutputKeys.INDENT, "yes");//$NON-NLS-1$
      tf.setOutputProperty(OutputKeys.METHOD, "xml");//$NON-NLS-1$
      tf.setOutputProperty(OutputKeys.STANDALONE, "yes");//$NON-NLS-1$
View Full Code Here

Examples of javax.xml.transform.TransformerFactory.newTransformer()

  private static void transformConfig(File config, String styleSheet, Result target)
      throws TransformerFactoryConfigurationError,
      TransformerConfigurationException, TransformerException {
    TransformerFactory tf = TransformerFactory.newInstance();
    Transformer t = tf.newTransformer(new StreamSource(MigrationUtil.class.getResourceAsStream(styleSheet)));
    t.setParameter("version", ApplicationInfo.getInstance().getReleaseNumber()); //$NON-NLS-1$
    t.transform(new StreamSource(config), target);
  }

  /**
 
View Full Code Here

Examples of javax.xml.transform.TransformerFactory.newTransformer()

        }

        ByteArrayOutputStream baos = new ByteArrayOutputStream(2048);
        try {
            TransformerFactory tFactory = TransformerFactory.newInstance();
            Transformer transformer = tFactory.newTransformer();

            DOMSource source = new DOMSource(doc);
            StreamResult result = new StreamResult(baos);
            transformer.transform(source, result);
        } catch (TransformerException e) {
View Full Code Here

Examples of javax.xml.transform.TransformerFactory.newTransformer()

    public static String getDocumentAsString(Document doc)
            throws TransformerException {
        StringWriter writer = new StringWriter();

        TransformerFactory factory = TransformerFactory.newInstance();
        Transformer transformer = factory.newTransformer();
        transformer.transform(new DOMSource(doc), new StreamResult(writer));

        return writer.toString();
    }
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.