Package org.chiba.xml.xslt.impl

Examples of org.chiba.xml.xslt.impl.CachingTransformerService


            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

TOP

Related Classes of org.chiba.xml.xslt.impl.CachingTransformerService

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.