public boolean shouldRun() throws SaxonApiException { String testExpr = ((When) step).getTest(); XdmNode doc = null; NamespaceBinding nsbinding = new NamespaceBinding(runtime, step.getNode()); Hashtable<QName,RuntimeValue> globals = parent.getInScopeOptions(); ReadablePipe reader = inputs.get("#xpath-context").firstElement(); doc = reader.read(); if (reader.moreDocuments() || inputs.get("#xpath-context").size() > 1) { throw XProcException.dynamicError(5); } // Surround testExpr with "boolean()" to force the EBV. Vector<XdmItem> results = evaluateXPath(doc, nsbinding.getNamespaceBindings(), "boolean(" + testExpr + ")", globals); if (results.size() != 1) { throw new XProcException("Attempt to compute EBV in p:when did not return a singleton!?"); } XdmAtomicValue value = (XdmAtomicValue) results.get(0); return value.getBooleanValue(); }
public boolean shouldRun() throws SaxonApiException { String testExpr = ((When) step).getTest(); XdmNode doc = null; NamespaceBinding nsbinding = new NamespaceBinding(runtime, step.getNode()); Hashtable<QName,RuntimeValue> globals = parent.getInScopeOptions(); ReadablePipe reader = inputs.get("#xpath-context").firstElement(); doc = reader.read(); if (reader.moreDocuments() || inputs.get("#xpath-context").size() > 1) { throw XProcException.dynamicError(5); } // Surround testExpr with "boolean()" to force the EBV. Vector<XdmItem> results = evaluateXPath(doc, nsbinding.getNamespaceBindings(), "boolean(" + testExpr + ")", globals); if (results.size() != 1) { throw new XProcException("Attempt to compute EBV in p:when did not return a singleton!?"); } XdmAtomicValue value = (XdmAtomicValue) results.get(0); return value.getBooleanValue(); }
data.setIterationSize(isize); inScopeOptions = parent.getInScopeOptions(); for (Variable var : step.getVariables()) { RuntimeValue value = computeValue(var);
public void run() throws SaxonApiException { inScopeOptions = parent.getInScopeOptions(); for (Variable var : step.getVariables()) { RuntimeValue value = computeValue(var);
inScopeOptions = parent.getInScopeOptions();
data.setIterationSize(isize); inScopeOptions = parent.getInScopeOptions(); for (Variable var : step.getVariables()) { RuntimeValue value = computeValue(var);
inScopeOptions = parent.getInScopeOptions(); for (QName name : step.getOptions()) { Option option = step.getOption(name);
inScopeOptions = parent.getInScopeOptions(); for (QName name : step.getOptions()) { Option option = step.getOption(name);
inScopeOptions = parent.getInScopeOptions();
inScopeOptions = parent.getInScopeOptions(); for (QName name : step.getOptions()) { Option option = step.getOption(name);
inScopeOptions = parent.getInScopeOptions(); for (QName name : step.getOptions()) { Option option = step.getOption(name);
public void run() throws SaxonApiException { inScopeOptions = parent.getInScopeOptions(); for (Variable var : step.getVariables()) { RuntimeValue value = computeValue(var);
sequenceLength = 0; inScopeOptions = parent.getInScopeOptions(); inScopeOptions = parent.getInScopeOptions(); for (Variable var : step.getVariables()) { RuntimeValue value = computeValue(var);
sequenceLength = 1; inScopeOptions = parent.getInScopeOptions(); inScopeOptions = parent.getInScopeOptions(); for (Variable var : step.getVariables()) { RuntimeValue value = computeValue(var);
sequenceLength = 0; inScopeOptions = parent.getInScopeOptions(); inScopeOptions = parent.getInScopeOptions(); for (Variable var : step.getVariables()) { RuntimeValue value = computeValue(var);
sequenceLength = 1; inScopeOptions = parent.getInScopeOptions(); inScopeOptions = parent.getInScopeOptions(); for (Variable var : step.getVariables()) { RuntimeValue value = computeValue(var);
inScopeOptions = ((XCompoundStep) forStep).getInScopeOptions(); } catch (ClassCastException cce) {
inScopeOptions = ((XCompoundStep) forStep).getInScopeOptions(); } catch (ClassCastException cce) {
inScopeOptions = parent.getInScopeOptions(); for (Variable var : step.getVariables()) { RuntimeValue value = computeValue(var);
inScopeOptions = parent.getInScopeOptions(); for (Variable var : step.getVariables()) { RuntimeValue value = computeValue(var);