Package javax.xml.transform

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


         org.xml.sax.SAXException  {

    TransformerFactory tFactory = TransformerFactory.newInstance();
    Transformer transformer = null;
    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));
    }
View Full Code Here


    ByteArrayOutputStream boutArray = new ByteArrayOutputStream();

    TransformerFactory tFactory = TransformerFactory.newInstance();
    Transformer transformer = null;
    try {
      transformer = tFactory.newTransformer(new StreamSource(xslDocUri));
    }
    catch (Exception e) {
      logger.fatal(e.getMessage(), e);
      throw new IOException(e.getMessage());
    }
View Full Code Here

            throw new IllegalArgumentException("HTMLwithXSLBuilder2::transform : Illegal argument for HTML output");
        }

      try {
          TransformerFactory tFactory = TransformerFactory.newInstance();
          Transformer transformer = tFactory.newTransformer(tXslSource);

            // Set the Stylesheet params (if any)
            if (aParamList != null) {
                String tKey;
                Object tValue;
View Full Code Here

      if (transformer == null)
      {
        XMLHelper.setTransformerProperties();

        TransformerFactory tFactory = TransformerFactory.newInstance();
        transformer = tFactory
            .newTransformer(new StreamSource(xslFile));
        mTransformers.put(Thread.currentThread().getName() + xslFile,
            transformer);
      }
    }
View Full Code Here

      if (transformer == null)
      {
        XMLHelper.setTransformerProperties();

        TransformerFactory tFactory = TransformerFactory.newInstance();
        transformer = tFactory
            .newTransformer(new StreamSource(xslFile));
        mTransformers.put(Thread.currentThread().getName() + xslFile,
            transformer);
      }
    }
View Full Code Here

      if(systemId != null)
          xslStreamSource = new StreamSource(new StringReader(xslString), systemId);
      else
          xslStreamSource = new StreamSource(new StringReader(xslString));

      Transformer transformer = transformerFactory.newTransformer(xslStreamSource);
      if(params != null) {
          Iterator iter = params.entrySet().iterator();
          while(iter.hasNext()) {
              Map.Entry entry = (Map.Entry)iter.next();
              transformer.setParameter((String)entry.getKey(), (String)entry.getValue());
View Full Code Here

                final TransformerFactory factory = TransformerFactory.newInstance();
                final URL xslt = new File(transformation).toURL();
                if (xslt != null)
                {
                    final Source xsltSource = new StreamSource(xslt.openStream());
                    final javax.xml.transform.Transformer transformer = factory.newTransformer(xsltSource);
                    final ByteArrayOutputStream output = new ByteArrayOutputStream();
                    final Result result = new StreamResult(output);
                    transformer.transform(
                        xmlSource,
                        result);
View Full Code Here

                        resolver.setLocation(xslt);
                        if (xslt != null)
                        {
                            AndroMDALogger.info("Applying transformation --> '" + xslt + "'");
                            final Source xsltSource = new StreamSource(xslt.openStream());
                            final javax.xml.transform.Transformer transformer = factory.newTransformer(xsltSource);
                            final ByteArrayOutputStream output = new ByteArrayOutputStream();
                            final Result result = new StreamResult(output);
                            transformer.transform(modelSource, result);
                            final byte[] outputResult = output.toByteArray();
                            stream = new ByteArrayInputStream(outputResult);
View Full Code Here

  {
    executor = Executors.newCachedThreadPool();
    TransformerFactory transFact = TransformerFactory.newInstance();
    ClassLoader cl = RDFaParser.class.getClassLoader();
    InputStream xslt = cl.getResourceAsStream(RDFaParser.XSLT);
    transformer = transFact.newTransformer(new StreamSource(xslt));
  }

  /**
   * Returns the RDF format for this factory.
   */
 
View Full Code Here

    throws TransformerConfigurationException
  {
    executor = Executors.newSingleThreadExecutor();
    TransformerFactory transFact = TransformerFactory.newInstance();
    ClassLoader cl = RDFaParser.class.getClassLoader();
    transformer = transFact.newTransformer(new StreamSource(cl.getResourceAsStream(XSLT)));
  }

  RDFaParser(Executor executor, Transformer transformer) {
    this.executor = executor;
    this.transformer = transformer;
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.