Package org.chiba.xml.xslt

Examples of org.chiba.xml.xslt.TransformerService


            if (logger.isDebugEnabled()) {
                logger.debug("log4j initialized");
            }

            // 2. init transformer service
            TransformerService transformerService = new CachingTransformerService(new FileResourceResolver());
            transformerService.setTransformerFactory(TransformerFactory.newInstance());

            if (Boolean.valueOf(getInitParameter(PARAM_XSLT_CACHE)).booleanValue()) {
                if (logger.isDebugEnabled()) {
                    logger.debug("initializing xslt cache");
                }

                // load default stylesheet
                // todo: extract parameter names
                String xsltPath = getServletContext().getInitParameter("chiba.web.xslt.path");
                String xsltDefault = getServletContext().getInitParameter("chiba.web.xslt.default");
                URI uri = new File(getServletContext().getRealPath(xsltPath)).toURI().resolve(new URI(xsltDefault));
                transformerService.getTransformer(uri);
            }

            // store service in servlet context
            // todo: contemplate about transformer service thread-safety
            getServletContext().setAttribute(TransformerService.class.getName(), transformerService);
View Full Code Here


            adapter.setContextParam(AbstractHTTPConnector.ACCEPT_LANGUAGE, acceptLanguage);
        }
    }

    protected UIGenerator createUIGenerator(HttpServletRequest request, XFormsSession session, String actionURL, String xslFile, String js) throws URISyntaxException, XFormsConfigException {
        TransformerService transformerService = (TransformerService) getServletContext().getAttribute(TransformerService.class.getName());
        URI uri = new File(getServletContext().getRealPath(xsltPath)).toURI().resolve(new URI(xslFile));

        XSLTGenerator generator = new XSLTGenerator();
        generator.setTransformerService(transformerService);
        generator.setStylesheetURI(uri);
View Full Code Here

TOP

Related Classes of org.chiba.xml.xslt.TransformerService

Copyright © 2018 www.massapicom. 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.