/** * Factory method to make a PreparedStylesheet * @param source the source of this principal stylesheet module * @param config the Saxon configuration * @param info compile-time options for this stylesheet compilation * @return the prepared stylesheet */ public static PreparedStylesheet compile(Source source, Configuration config, CompilerInfo info) throws TransformerConfigurationException { PreparedStylesheet pss = new PreparedStylesheet(config, info); pss.prepare(source); return pss; }
/** * Factory method to make a PreparedStylesheet * @param source the source of this principal stylesheet module * @param config the Saxon configuration * @param info compile-time options for this stylesheet compilation * @return the prepared stylesheet */ public static PreparedStylesheet compile(Source source, Configuration config, CompilerInfo info) throws TransformerConfigurationException { PreparedStylesheet pss = new PreparedStylesheet(config, info); pss.prepare(source); return pss; }
/** * Process the Source into a Templates object, which is a * a compiled representation of the source. This Templates object * may then be used concurrently across multiple threads. Creating * a Templates object allows the TransformerFactory to do detailed * performance optimization of transformation instructions, without * penalizing runtime transformation. * * @param source An object that holds a URL, input stream, etc. * @param info compile-time options for this stylesheet compilation * * @return A Templates object capable of being used for transformation purposes, * never null. * * @exception TransformerConfigurationException May throw this during the parse when it * is constructing the Templates object and fails. */ public Templates newTemplates(Source source, CompilerInfo info) throws TransformerConfigurationException { PreparedStylesheet pss = new PreparedStylesheet(config, info); pss.prepare(source); return pss; }
/** * Process the Source into a Templates object, which is a * a compiled representation of the source. This Templates object * may then be used concurrently across multiple threads. Creating * a Templates object allows the TransformerFactory to do detailed * performance optimization of transformation instructions, without * penalizing runtime transformation. * * @param source An object that holds a URL, input stream, etc. * @param info compile-time options for this stylesheet compilation * * @return A Templates object capable of being used for transformation purposes, * never null. * * @exception TransformerConfigurationException May throw this during the parse when it * is constructing the Templates object and fails. */ public Templates newTemplates(Source source, CompilerInfo info) throws TransformerConfigurationException { PreparedStylesheet pss = new PreparedStylesheet(config, info); pss.prepare(source); return pss; }
/** * Process the Source into a Templates object, which is a * a compiled representation of the source. This Templates object * may then be used concurrently across multiple threads. Creating * a Templates object allows the TransformerFactory to do detailed * performance optimization of transformation instructions, without * penalizing runtime transformation. * * @param source An object that holds a URL, input stream, etc. * * @return A Templates object capable of being used for transformation purposes, * never null. * * @exception TransformerConfigurationException May throw this during the parse when it * is constructing the Templates object and fails. */ public Templates newTemplates(Source source) throws TransformerConfigurationException { CompilerInfo info = new CompilerInfo(); info.setURIResolver(config.getURIResolver()); info.setErrorListener(config.getErrorListener()); info.setCompileWithTracing(config.isCompileWithTracing()); PreparedStylesheet pss = new PreparedStylesheet(config, info); pss.prepare(source); return pss; }
/** * Link this package with the packages it uses, to form an executable stylesheet. This process fixes * up any cross-package references to files, templates, and other components, and checks to ensure * that all such references are consistent. * * @return the resulting XsltExecutable * @throws SaxonApiException if any error is found during the linking process, for example * if the constituent packages containing duplicate component names, or if abstract components * are not resolved. */ public XsltExecutable link() throws SaxonApiException { try { Configuration config = processor.getUnderlyingConfiguration(); CompilerInfo info = config.makeCompilerInfo(); Compilation compilation = new Compilation(config, info); stylesheetPackage.checkForAbstractComponents(); PreparedStylesheet pss = new PreparedStylesheet(compilation); stylesheetPackage.updatePreparedStylesheet(pss); pss.addPackage(stylesheetPackage); return new XsltExecutable(processor, pss); } catch (XPathException e) { throw new SaxonApiException(e); } }
/** * Get the Templates object to used for a transformation */ public Templates getTemplates() { if (templates==null) { DocumentImpl doc = (DocumentImpl)builder.getCurrentRoot(); if (doc==null) { return null; } final Configuration config = getConfiguration(); CompilerInfo info = new CompilerInfo(); info.setURIResolver(config.getURIResolver()); info.setErrorListener(config.getErrorListener()); info.setCompileWithTracing(config.isCompileWithTracing()); PreparedStylesheet sheet = new PreparedStylesheet(config, info); try { sheet.setStylesheetDocument(doc, nodeFactory); templates = sheet; } catch (XPathException tce) { // don't know why we aren't allowed to just throw it! throw new UnsupportedOperationException(tce.getMessage()); } } return templates; }
/** * Process the Source into a Templates object, which is a * a compiled representation of the source. This Templates object * may then be used concurrently across multiple threads. Creating * a Templates object allows the TransformerFactory to do detailed * performance optimization of transformation instructions, without * penalizing runtime transformation. * * @param source An object that holds a URL, input stream, etc. * * @return A Templates object capable of being used for transformation purposes, * never null. * * @exception TransformerConfigurationException May throw this during the parse when it * is constructing the Templates object and fails. */ public Templates newTemplates(Source source) throws TransformerConfigurationException { CompilerInfo info = new CompilerInfo(); info.setURIResolver(config.getURIResolver()); info.setErrorListener(config.getErrorListener()); info.setCompileWithTracing(config.isCompileWithTracing()); PreparedStylesheet pss = new PreparedStylesheet(config, info); pss.prepare(source); return pss; }
/** * Link this package with the packages it uses, to form an executable stylesheet. This process fixes * up any cross-package references to files, templates, and other components, and checks to ensure * that all such references are consistent. * * @return the resulting XsltExecutable * @throws SaxonApiException if any error is found during the linking process, for example * if the constituent packages containing duplicate component names, or if abstract components * are not resolved. */ public XsltExecutable link() throws SaxonApiException { try { Configuration config = getProcessor().getUnderlyingConfiguration(); CompilerInfo info = compiler.getUnderlyingCompilerInfo(); Compilation compilation = new Compilation(config, info); compilation.setPackageData(stylesheetPackage); stylesheetPackage.checkForAbstractComponents(); PreparedStylesheet pss = new PreparedStylesheet(compilation); stylesheetPackage.updatePreparedStylesheet(pss); pss.addPackage(stylesheetPackage); return new XsltExecutable(getProcessor(), pss); } catch (XPathException e) { throw new SaxonApiException(e); } }
info.setErrorListener(config.getErrorListener()); info.setCompileWithTracing(config.isCompileWithTracing()); PreparedStylesheet sheet = new PreparedStylesheet(config, info);
StylesheetPackage pack = loader.loadPackageDoc(packageBuilder.getCurrentRoot()); compilation.setPackageData(pack); PreparedStylesheet pss = new PreparedStylesheet(compilation); pack.checkForAbstractComponents(); pack.updatePreparedStylesheet(pss); compilation.getImportStack().pop(); PreparedStylesheet pss = new PreparedStylesheet(compilation); PrincipalStylesheetModule psm = compilation.compilePackage(doc); if (compilation.getErrorCount() > 0) {
StylesheetPackage pack = loader.loadPackageDoc(packageBuilder.getCurrentRoot()); compilation.setPackageData(pack); PreparedStylesheet pss = new PreparedStylesheet(compilation); pack.checkForAbstractComponents(); pack.updatePreparedStylesheet(pss); compilation.getImportStack().pop(); PreparedStylesheet pss = new PreparedStylesheet(compilation); PrincipalStylesheetModule psm = compilation.compilePackage(doc); if (compilation.getErrorCount() > 0) {