Examples of newTransformer()


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

      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

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

      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

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

                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

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

                        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

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

  {
    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

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

    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

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

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

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

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

    TransformerFactory tfactory = TransformerFactory.newInstance();
    // This creates a transformer that does a simple identity transform,
    // and thus can be used for all intents and purposes as a serializer.
    try
    {
      serializer = tfactory.newTransformer();
      serializer.setOutputProperty(OutputKeys.INDENT, "yes");
      serializer.setOutputProperty(OutputKeys.METHOD, "xml");
      serializer.setOutputProperty(OutputKeys.ENCODING, Constants
          .getXMLEncoding());
      if ((systemID != null) && (systemID.length() > 0))
View Full Code Here

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

                final Source xmlSource = new DOMSource(this.urlToDocument(xmlDocument));
                final TransformerFactory factory = TransformerFactory.newInstance();
                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

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

            StreamSource xml = new StreamSource( xmlstream );

            /* Transform */
            StreamResult output = new StreamResult( response.getWriter(  ) );
            Transformer  transformer = factory.newTransformer( xsl );
            Map          params = getXslParameters( request, response );
            if ( params != null )
            {
                Iterator it = params.keySet(  ).iterator(  );
                while ( it.hasNext(  ) )
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.