Examples of Templates


Examples of com.dotcms.repackage.javax.xml.transform.Templates

            // Create transformer factory
            TransformerFactory factory = TransformerFactory.newInstance();

            Logger.debug(this, "factory : " +  factory);
            // Use the factory to create a template containing the xsl file
            Templates template = factory.newTemplates(new StreamSource(
                    getClass().getClassLoader().getResourceAsStream(xslPath)));

           
            System.out.println("template : " +  template);
            // Use the template to create a transformer
View Full Code Here

Examples of com.mysema.query.types.Templates

public class SubQueryTest {

    @SuppressWarnings("unchecked")
    @Test
    public void test() {
        Templates templates = new JavaTemplates();
        QueryMetadata metadata = new DefaultQueryMetadata();
        List<ExtendedSubQueryExpression> subQueries = Arrays.<ExtendedSubQueryExpression>asList(
                new BooleanSubQuery(metadata),
                new ComparableSubQuery(Date.class,metadata),
                new DateSubQuery(Date.class,metadata),
View Full Code Here

Examples of com.vtence.molecule.templating.Templates

public class TemplatingAndLayoutExample {

    public void run(WebServer server) throws IOException {
        // We use Mustache templates with an .html extension
        Templates templates = new Templates(
                new JMustacheRenderer().fromDir(locateOnClasspath("examples/templates")).extension("html"));
        final Template layout = templates.named("layout");
        final Template greeting = templates.named("greeting");

        // Apply a common layout to all rendered pages
        server.filter("/", Layout.html(layout))
              .start(new DynamicRoutes() {{
                  get("/hello").to(new Application() {
View Full Code Here

Examples of javax.xml.transform.Templates

      throw new FileNotFoundException(sFilePath);
    }
    long lastMod = oFile.lastModified();

    TransformerFactory oFactory;
    Templates oTemplates;
    StreamSource oStreamSrc;
    SheetEntry oSheet = (SheetEntry) oCache.get(sFilePath);

    if (null!=oSheet) {
      if (DebugFile.trace) {
View Full Code Here

Examples of javax.xml.transform.Templates

    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

      _xsltcFactory.setErrorListener(_errorlistener);     
  }
  if (_uriresolver != null) {
      _xsltcFactory.setURIResolver(_uriresolver);
  }
  Templates templates = _xsltcFactory.newTemplates(src);
  if (templates == null ) return null;
  return newXMLFilter(templates);
    }
View Full Code Here

Examples of javax.xml.transform.Templates

        concurrently across multiple threads. Creating a Templates object
        allows the TransformerFactory to do detailed performance optimization
        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

   {
      StreamSource source = new StreamSource( srcIs );
      StreamResult result = new StreamResult( destOs );
      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

                        + transformTarget.getXslFilename());

        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.Templates

  private void cacheStyleSheet(Class<?> resourceClass, String path) throws TransformerConfigurationException{
    InputStream inputStream = resourceClass.getResourceAsStream(path);
    Source xsltSource = new StreamSource(inputStream);
    TransformerFactory transFact = TransformerFactory.newInstance();
    Templates templates = transFact.newTemplates(xsltSource);

    try {inputStream.close();} catch (IOException e) {}

    this.templates = templates;
    this.resourceClass = resourceClass;
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.