/** * Construct a new context as a copy of another. The new context is effectively added * to the top of a stack, and contains a pointer to the previous context */ public XPathContextMajor newContext() { Controller controller = new Controller(config); return controller.newXPathContext(); // notAllowed(); // return null; }
/** * Construct a new context as a copy of another. The new context is effectively added * to the top of a stack, and contains a pointer to the previous context */ public XPathContextMajor newContext() { Controller controller = new Controller(config); return controller.newXPathContext(); // notAllowed(); // return null; }
/** * Construct a new context as a copy of another. The new context is effectively added * to the top of a stack, and contains a pointer to the previous context */ public XPathContextMajor newContext() { Controller controller = new Controller(config); return controller.newXPathContext(); // notAllowed(); // return null; }
/** * Make a Transformer from this Templates object. * * @return the new Transformer (always a Controller) * @see net.sf.saxon.Controller */ public Transformer newTransformer() { Controller c = new Controller(config, executable); c.setPreparedStylesheet(this); return c; }
/** * Make a Transformer from this Templates object. * * @return the new Transformer (always a Controller) * @see net.sf.saxon.Controller */ public Transformer newTransformer() { Controller c = new Controller(config, executable); c.setPreparedStylesheet(this); return c; }
/** * Get a controller that can be used to execute functions in this compiled query. * Functions in the query module can be found using {@link QueryModule#getUserDefinedFunction}. * They can then be called directly from the Java application using {@link net.sf.saxon.expr.instruct.UserFunction#call} * The same Controller can be used for a series of function calls. Note that the Controller should only be used * in a single thread. * @param env the dynamic context for evaluation * @return a newly constructed Controller * @throws XPathException if evaluation fails with a dynamic error */ /*@NotNull*/ public Controller newController(DynamicQueryContext env) throws XPathException { Controller controller = new Controller(executable.getConfiguration(), executable); env.initializeController(controller); //controller.getBindery(getPackageData()).allocateGlobals(executable.getGlobalVariableMap()); return controller; }
/** * Get a controller that can be used to execute functions in this compiled query. * Functions in the query module can be found using {@link QueryModule#getUserDefinedFunction}. * They can then be called directly from the Java application using {@link net.sf.saxon.expr.instruct.UserFunction#call} * The same Controller can be used for a series of function calls. Note that the Controller should only be used * in a single thread. * @param env the dynamic context for evaluation * @return a newly constructed Controller * @throws XPathException if evaluation fails with a dynamic error */ /*@NotNull*/ public Controller newController(DynamicQueryContext env) throws XPathException { Controller controller = new Controller(executable.getConfiguration(), executable); env.initializeController(controller); //controller.getBindery(getPackageData()).allocateGlobals(executable.getGlobalVariableMap()); return controller; }
public TreeWriter(Processor proc) { pool = proc.getUnderlyingConfiguration().getNamePool(); controller = new Controller(proc.getUnderlyingConfiguration()); }
public TreeWriter(Processor proc) { pool = proc.getUnderlyingConfiguration().getNamePool(); controller = new Controller(proc.getUnderlyingConfiguration()); }
/** * Get a controller that can be used to execute functions in this compiled query. * Functions in the query module can be found using {@link QueryModule#getUserDefinedFunction}. * They can then be called directly from the Java application using {@link net.sf.saxon.instruct.UserFunction#call} * The same Controller can be used for a series of function calls. Note that the Controller should only be used * in a single thread. * @return a newly constructed Controller */ public Controller newController() { Controller controller = new Controller(executable.getConfiguration(), executable); executable.initializeBindery(controller.getBindery()); return controller; }
/** * Constructor for use in free-standing Java applications. * @param item the item to use as the initial context item. If this is null, * the comtext item is initially undefined (which will cause a dynamic error * if it is referenced). * @param exec the Executable */ public XPathContextMajor(Item item, Executable exec) { controller = new Controller(exec.getConfiguration(), exec); if (item != null) { UnfailingIterator iter = SingletonIterator.makeIterator(item); iter.next(); currentIterator = iter; } origin = controller; }
/** * Constructor for use in free-standing Java applications. * @param item the item to use as the initial context item. If this is null, * the comtext item is initially undefined (which will cause a dynamic error * if it is referenced). * @param exec the Executable */ public XPathContextMajor(Item item, Executable exec) { controller = new Controller(exec.getConfiguration(), exec); if (item != null) { UnfailingIterator iter = SingletonIterator.makeIterator(item); iter.next(); currentIterator = iter; } origin = controller; }
/** * Constructor for use in free-standing Java applications. * @param item the item to use as the initial context item. If this is null, * the comtext item is initially undefined (which will cause a dynamic error * if it is referenced). * @param exec the Executable */ public XPathContextMajor(Item item, Executable exec) { controller = new Controller(exec.getConfiguration(), exec); if (item != null) { UnfailingIterator iter = SingletonIterator.makeIterator(item); iter.next(); currentIterator = iter; } origin = controller; }
public TreeWriter(XProcRuntime xproc) { runtime = xproc; pool = xproc.getProcessor().getUnderlyingConfiguration().getNamePool(); controller = new Controller(runtime.getProcessor().getUnderlyingConfiguration()); }
public TreeWriter(XProcRuntime xproc) { runtime = xproc; pool = xproc.getProcessor().getUnderlyingConfiguration().getNamePool(); controller = new Controller(runtime.getProcessor().getUnderlyingConfiguration()); }
/** * Constructor for use in free-standing Java applications. * @param item the item to use as the initial context item. If this is null, * the comtext item is initially undefined (which will cause a dynamic error * if it is referenced). * @param config the Saxon Configuration * @deprecated since 9.0 - use {@link #XPathContextMajor(Item, Executable)} */ public XPathContextMajor(Item item, Configuration config) { // No longer used internally but retained for backwards compatibility (8.8) Executable exec = new Executable(config); exec.setHostLanguage(Configuration.JAVA_APPLICATION); controller = new Controller(config, exec); if (item != null) { UnfailingIterator iter = SingletonIterator.makeIterator(item); iter.next(); currentIterator = iter; } origin = controller; }
/** * Constructor for use in free-standing Java applications. * @param item the item to use as the initial context item. If this is null, * the comtext item is initially undefined (which will cause a dynamic error * if it is referenced). * @param config the Saxon Configuration * @deprecated since 9.0 - use {@link #XPathContextMajor(Item, Executable)} */ public XPathContextMajor(Item item, Configuration config) { // No longer used internally but retained for backwards compatibility (8.8) Executable exec = new Executable(config); exec.setHostLanguage(Configuration.JAVA_APPLICATION); controller = new Controller(config, exec); if (item != null) { UnfailingIterator iter = SingletonIterator.makeIterator(item); iter.next(); currentIterator = iter; } origin = controller; }
/** * Get a controller that can be used to execute functions in this compiled query. * Functions in the query module can be found using {@link QueryModule#getUserDefinedFunction}. * They can then be called directly from the Java application using {@link net.sf.saxon.instruct.UserFunction#call} * The same Controller can be used for a series of function calls. Note that the Controller should only be used * in a single thread. * * @return a newly constructed Controller */ public Controller newController() { Controller controller = new Controller(executable.getConfiguration(), executable); executable.initializeBindery(controller.getBindery()); if (isUpdating && controller.getTreeModel() == Builder.TINY_TREE) { controller.setTreeModel(Builder.LINKED_TREE); } return controller; }
private XPathContext makeDynamicContext(UseWhenStaticContext staticContext) throws XPathException { Controller controller = new Controller(getConfiguration()); controller.getExecutable().setFunctionLibrary((FunctionLibraryList) staticContext.getFunctionLibrary()); if (staticContext.getXPathVersion() < 30) { controller.setURIResolver(new URIPreventer()); } controller.setCurrentDateTime(currentDateTime); // this is to ensure that all use-when expressions in a module use the same date and time XPathContext dynamicContext = controller.newXPathContext(); dynamicContext = dynamicContext.newCleanContext(); return dynamicContext; }
private XPathContext makeDynamicContext(UseWhenStaticContext staticContext) throws XPathException { Controller controller = new Controller(getConfiguration()); controller.getExecutable().setFunctionLibrary((FunctionLibraryList) staticContext.getFunctionLibrary()); if (staticContext.getXPathVersion() < 30) { controller.setURIResolver(new URIPreventer()); } controller.setCurrentDateTime(currentDateTime); // this is to ensure that all use-when expressions in a module use the same date and time XPathContext dynamicContext = controller.newXPathContext(); dynamicContext = dynamicContext.newCleanContext(); return dynamicContext; }