/** * Get the Rule Manager. * <p>This method is intended for internal use only.</p> * * @return the Rule Manager, used to hold details of template rules for * all modes; or null in the case of a non-XSLT controller */ public RuleManager getRuleManager() { Executable exec = getExecutable(); return exec instanceof PreparedStylesheet ? ((PreparedStylesheet) getExecutable()).getRuleManager() : null; }
/** * Get the Rule Manager. * <p>This method is intended for internal use only.</p> * * @return the Rule Manager, used to hold details of template rules for * all modes; or null in the case of a non-XSLT controller */ public RuleManager getRuleManager() { Executable exec = getExecutable(); return exec instanceof PreparedStylesheet ? ((PreparedStylesheet) getExecutable()).getRuleManager() : null; }
/** * Called at start */ public void open(/*@NotNull*/ Controller controller) { config = controller.getConfiguration(); lang = controller.getExecutable().getHostLanguage(); t_total = System.nanoTime(); }
/** * Called at start */ public void open(/*@NotNull*/ Controller controller) { config = controller.getConfiguration(); lang = controller.getExecutable().getHostLanguage(); t_total = System.nanoTime(); }
/** * Pre-evaluate global variables (when debugging/tracing). * <p> * This method is intended for internal use. * @param context the dynamic context for evaluating the global variables * @throws XPathException if a dynamic error occurs while evaluating the global variables. */ public void preEvaluateGlobals(XPathContext context) throws XPathException { HashMap vars = getExecutable().getCompiledGlobalVariables(); if (vars != null) { Iterator iter = vars.values().iterator(); while (iter.hasNext()) { GlobalVariable var = (GlobalVariable)iter.next(); var.evaluateVariable(context); } } }
/** * Get the default collation */ public final StringCollator getDefaultCollation() { if (controller != null) { return controller.getExecutable().getDefaultCollation(); } else { return CodepointCollator.getInstance(); } }
/** * Get the default collation */ public final StringCollator getDefaultCollation() { if (controller != null) { return controller.getExecutable().getDefaultCollation(); } else { return CodepointCollator.getInstance(); } }
/** * Get the default collation */ public final StringCollator getDefaultCollation() { if (controller != null) { return controller.getExecutable().getDefaultCollation(); } else { return CodepointCollator.getInstance(); } }
/** * Clear the document pool. * This is sometimes useful when re-using the same Transformer * for a sequence of transformations, but it isn't done automatically, because when * the transformations use common look-up documents, the caching is beneficial. */ public void clearDocumentPool() { for (PackageData pack : getExecutable().getPackages()) { sourceDocumentPool.discardIndexes(pack.getKeyManager()); } sourceDocumentPool = new DocumentPool(); }
/** * Clear the document pool. * This is sometimes useful when re-using the same Transformer * for a sequence of transformations, but it isn't done automatically, because when * the transformations use common look-up documents, the caching is beneficial. */ public void clearDocumentPool() { for (PackageData pack : getExecutable().getPackages()) { sourceDocumentPool.discardIndexes(pack.getKeyManager()); } sourceDocumentPool = new DocumentPool(); }
/** * Make a new XPath context for evaluating patterns if there is any possibility that the * pattern uses local variables * * @param context The existing XPath context * @return a new XPath context (or the existing context if no new context was created) */ private XPathContext perhapsMakeNewContext(XPathContext context) { int patternLocals = context.getController().getExecutable().getLargestPatternStackFrame(); if (patternLocals > 0) { context = context.newContext(); context.setOriginatingConstructType(Location.CONTROLLER); ((XPathContextMajor)context).openStackFrame(patternLocals); } return context; }
private static Receiver makeValidator(Receiver receiver, String systemId, ParseOptions options) throws XPathException { PipelineConfiguration pipe = receiver.getPipelineConfiguration(); Configuration config = pipe.getConfiguration(); int sv = options.getSchemaValidationMode(); if (sv != Validation.PRESERVE && sv != Validation.DEFAULT) { Controller controller = pipe.getController(); if (controller != null && !controller.getExecutable().isSchemaAware() && sv != Validation.STRIP) { throw new XPathException("Cannot use schema-validated input documents when the query/stylesheet is not schema-aware"); } } return receiver; }
private static Receiver makeValidator(Receiver receiver, String systemId, ParseOptions options) throws XPathException { PipelineConfiguration pipe = receiver.getPipelineConfiguration(); Configuration config = pipe.getConfiguration(); int sv = options.getSchemaValidationMode(); if (sv != Validation.PRESERVE && sv != Validation.DEFAULT) { Controller controller = pipe.getController(); if (controller != null && !controller.getExecutable().isSchemaAware() && sv != Validation.STRIP) { throw new XPathException("Cannot use schema-validated input documents when the query/stylesheet is not schema-aware"); } } return receiver; }
/** * Make a new XPath context for evaluating patterns if there is any possibility that the * pattern uses local variables * * @param context The existing XPath context * @return a new XPath context (or the existing context if no new context was created) */ private XPathContext perhapsMakeNewContext(XPathContext context) { int patternLocals = context.getController().getExecutable().getLargestPatternStackFrame(); if (patternLocals > 0) { context = context.newContext(); context.setOrigin(context.getController()); ((XPathContextMajor)context).openStackFrame(patternLocals); } return context; }
/** * Make a new XPath context for evaluating patterns if there is any possibility that the * pattern uses local variables * * @param context The existing XPath context * @return a new XPath context (or the existing context if no new context was created) */ private XPathContext perhapsMakeNewContext(XPathContext context) { int patternLocals = context.getController().getExecutable().getLargestPatternStackFrame(); if (patternLocals > 0) { context = context.newContext(); context.setOrigin(context.getController()); ((XPathContextMajor)context).openStackFrame(patternLocals); } return context; }
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; }
/** * Start of event stream */ public void open() throws XPathException { builder = controller.makeBuilder(); setPipelineConfiguration(builder.getPipelineConfiguration()); builder.setSystemId(systemId); Receiver stripper = controller.makeStripper(builder); if (controller.getExecutable().stripsInputTypeAnnotations()) { stripper = controller.getConfiguration().getAnnotationStripper(stripper); } setUnderlyingReceiver(stripper); nextReceiver.open(); }
/** * Start of event stream */ public void open() throws XPathException { builder = controller.makeBuilder(); setPipelineConfiguration(builder.getPipelineConfiguration()); builder.setSystemId(systemId); Receiver stripper = controller.makeStripper(builder); if (controller.getExecutable().stripsInputTypeAnnotations()) { stripper = controller.getConfiguration().getAnnotationStripper(stripper); } setUnderlyingReceiver(stripper); nextReceiver.open(); }
/** * Start of event stream */ public void open() throws XPathException { builder = controller.makeBuilder(); setPipelineConfiguration(builder.getPipelineConfiguration()); builder.setSystemId(systemId); Receiver stripper = controller.makeStripper(builder); if (controller.getExecutable().stripsInputTypeAnnotations()) { stripper = controller.getConfiguration().getAnnotationStripper(stripper); } setUnderlyingReceiver(stripper); nextReceiver.open(); }