/** * Loads all of the XSL executables. This is a time consuming operation. * * @param index * @param sourcesName * A stylesheet reference. * @throws Exception * If the stylesheet fail to compile. */ public void preload(Index index, String sourcesName) throws Exception { for (String key : index.getTestKeys()) { TestEntry te = index.getTest(key); loadExecutable(te, sourcesName); } for (String key : index.getFunctionKeys()) { List<FunctionEntry> functions = index.getFunctions(key); for (FunctionEntry fe : functions) { if (!fe.isJava()) { loadExecutable(fe, sourcesName); } } } }
/** * Loads all of the XSL executables. This is a time consuming operation. * * @param index * @param sourcesName * A stylesheet reference. * @throws Exception * If the stylesheet fail to compile. */ public void preload(Index index, String sourcesName) throws Exception { for (String key : index.getTestKeys()) { TestEntry te = index.getTest(key); loadExecutable(te, sourcesName); } for (String key : index.getFunctionKeys()) { List<FunctionEntry> functions = index.getFunctions(key); for (FunctionEntry fe : functions) { if (!fe.isJava()) { loadExecutable(fe, sourcesName); } } } }
XPathContext getXPathContext(TestEntry test, String sourcesName, XdmNode contextNode) throws Exception { XPathContext context = null; if (test.usesContext()) { XsltExecutable xe = engine.loadExecutable(test, sourcesName); Executable ex = xe.getUnderlyingCompiledStylesheet() .getExecutable(); context = new XPathContextMajor(contextNode.getUnderlyingNode(), ex); } return context; }
XPathContext getXPathContext(TestEntry test, String sourcesName, XdmNode contextNode) throws Exception { XPathContext context = null; if (test.usesContext()) { XsltExecutable xe = engine.loadExecutable(test, sourcesName); Executable ex = xe.getUnderlyingCompiledStylesheet() .getExecutable(); context = new XPathContextMajor(contextNode.getUnderlyingNode(), ex); } return context; }
throw new Exception("Execution was stopped by the user."); XsltExecutable executable = engine.loadExecutable(template, opts.getSourcesName()); XsltTransformer xt = executable.load();
throw new Exception("Execution was stopped by the user."); XsltExecutable executable = engine.loadExecutable(template, opts.getSourcesName()); XsltTransformer xt = executable.load();