public XOutput getOutput(String port) { if (xoutputs.containsKey(port)) { return xoutputs.get(port); } else { if (XProcConstants.NS_XPROC.equals(step.getType().getNamespaceURI()) && step.getStep().getVersion() > 1.0) { return null; } else { throw new XProcException(step.getNode(), "Attempt to get non-existant output '" + port + "' port from step."); } } }
public XOutput getOutput(String port) { if (xoutputs.containsKey(port)) { return xoutputs.get(port); } else { if (XProcConstants.NS_XPROC.equals(step.getType().getNamespaceURI()) && step.getStep().getVersion() > 1.0) { return null; } else { throw new XProcException(step.getNode(), "Attempt to get non-existant output '" + port + "' port from step."); } } }
protected void augmentOptions() { Step decl = declaration; if (decl == null) { throw new UnsupportedOperationException("Unexpected step type: " + getType()); } Hashtable<QName,Option> declOptions = new Hashtable<QName,Option> (); for (Option option : decl.options()) { declOptions.put(option.getName(), option); } // Add any options that have default values... for (QName oname : declOptions.keySet()) { Option doption = declOptions.get(oname); Option option = getOption(oname); if (option == null) { if (doption.getSelect() != null || doption.getBinding().size() != 0) { addOption(doption); } } else { option.setType(doption.getType(), doption.getNode()); // copy the type over } } }
protected void augmentOptions() { Step decl = declaration; if (decl == null) { throw new UnsupportedOperationException("Unexpected step type: " + getType()); } Hashtable<QName,Option> declOptions = new Hashtable<QName,Option> (); for (Option option : decl.options()) { declOptions.put(option.getName(), option); } // Add any options that have default values... for (QName oname : declOptions.keySet()) { Option doption = declOptions.get(oname); Option option = getOption(oname); if (option == null) { if (doption.getSelect() != null || doption.getBinding().size() != 0) { addOption(doption); } } else { option.setType(doption.getType(), doption.getNode()); // copy the type over } } }
public void run() throws SaxonApiException { logger.trace("Running " + step.getType());
private void xmlReport(Step step) { pr.print("<step xml:base='" + step.getNode().getBaseURI() + "'"); pr.print(" type='" + step.getType().getClarkName() + "'"); if (step.getDeclaredType() != null) { pr.print(" declared-type='" + step.getDeclaredType().getClarkName() + "'"); } pr.print(" name='" + step.getName() + "'"); pr.println(">"); for (Input input : step.inputs()) { xmlReport(input); } for (Output output : step.outputs()) { xmlReport(output); } for (Parameter param : step.parameters()) { xmlReport(param); } for (Option option : step.options()) { xmlReport(option); } for (Variable var : step.getVariables()) { xmlReport(var); } for (Step substep : step.subpipeline()) { xmlReport(substep); } pr.println("</step>"); }
private void xmlReport(Step step) { pr.print("<step xml:base='" + step.getNode().getBaseURI() + "'"); pr.print(" type='" + step.getType().getClarkName() + "'"); if (step.getDeclaredType() != null) { pr.print(" declared-type='" + step.getDeclaredType().getClarkName() + "'"); } pr.print(" name='" + step.getName() + "'"); pr.println(">"); for (Input input : step.inputs()) { xmlReport(input); } for (Output output : step.outputs()) { xmlReport(output); } for (Parameter param : step.parameters()) { xmlReport(param); } for (Option option : step.options()) { xmlReport(option); } for (Variable var : step.getVariables()) { xmlReport(var); } for (Step substep : step.subpipeline()) { xmlReport(substep); } pr.println("</step>"); }
public void run() throws SaxonApiException { logger.trace("Running " + step.getType());
if (XProcConstants.p_choose.equals(substep.getType())) { XChoose newstep = new XChoose(runtime, substep, this); newstep.instantiate(substep); } else if (XProcConstants.p_group.equals(substep.getType())) { XGroup newstep = new XGroup(runtime, substep, this); newstep.instantiate(substep); } else if (XProcConstants.p_try.equals(substep.getType())) { XTry newstep = new XTry(runtime, substep, this); newstep.instantiate(substep); } else if (XProcConstants.p_catch.equals(substep.getType())) { XCatch newstep = new XCatch(runtime, substep, this); newstep.instantiate(substep); } else if (XProcConstants.p_for_each.equals(substep.getType())) { XForEach newstep = new XForEach(runtime, substep, this); newstep.instantiate(substep); } else if (XProcConstants.p_viewport.equals(substep.getType())) { XViewport newstep = new XViewport(runtime, substep, this); newstep.instantiate(substep); } else if (XProcConstants.cx_until_unchanged.equals(substep.getType())) { XUntilUnchanged newstep = new XUntilUnchanged(runtime,substep,this); newstep.instantiate(substep);
if (XProcConstants.p_choose.equals(substep.getType())) { XChoose newstep = new XChoose(runtime, substep, this); newstep.instantiate(substep); } else if (XProcConstants.p_group.equals(substep.getType())) { XGroup newstep = new XGroup(runtime, substep, this); newstep.instantiate(substep); } else if (XProcConstants.p_try.equals(substep.getType())) { XTry newstep = new XTry(runtime, substep, this); newstep.instantiate(substep); } else if (XProcConstants.p_catch.equals(substep.getType())) { XCatch newstep = new XCatch(runtime, substep, this); newstep.instantiate(substep); } else if (XProcConstants.p_for_each.equals(substep.getType())) { XForEach newstep = new XForEach(runtime, substep, this); newstep.instantiate(substep); } else if (XProcConstants.p_viewport.equals(substep.getType())) { XViewport newstep = new XViewport(runtime, substep, this); newstep.instantiate(substep); } else if (XProcConstants.cx_until_unchanged.equals(substep.getType())) { XUntilUnchanged newstep = new XUntilUnchanged(runtime,substep,this); newstep.instantiate(substep);
if (XProcConstants.p_in_scope_names.equals(step.getType())) { for (QName name : inScopeOptions.keySet()) { xstep.setParameter(name, inScopeOptions.get(name));
} else { valid = false; error("Parameter input " + input.getPort() + " unbound on " + getType() + " step named " + getName() + " and no default binding available.", XProcConstants.staticError(55)); error("Input " + input.getPort() + " unbound on " + getType() + " step named " + getName() + " and no default binding available.", XProcConstants.staticError(32)); if ("error".equals(pipe.getPort()) && XProcConstants.p_catch.equals(fromstep.getType())) { catchErrors = true; } else { if (XProcConstants.NS_XPROC.equals(fromstep.getType().getNamespaceURI()) && getVersion() > 1.0) { if (XProcConstants.p_viewport.equals(step.getType())) { if (output == null) { fromstep = env.visibleStep(pipe.getStep()); if ("error".equals(pipe.getPort()) && XProcConstants.p_catch.equals(fromstep.getType())) { catchErrors = true;
} else { valid = false; error("" + endpoint + " unbound on " + getType() + " step named " + getName() + " and no default readable port.", XProcConstants.staticError(32)); if (output == null) { Step fromstep = env.visibleStep(pipe.getStep()); if ("error".equals(pipe.getPort()) && XProcConstants.p_catch.equals(fromstep.getType())) { catchErrors = true; } else { if (output == null) { fromstep = env.visibleStep(pipe.getStep()); if ("error".equals(pipe.getPort()) && XProcConstants.p_catch.equals(fromstep.getType())) { catchErrors = true;
} else { valid = false; error("" + endpoint + " unbound on " + getType() + " step named " + getName() + " and no default readable port.", XProcConstants.staticError(32)); if (output == null) { Step fromstep = env.visibleStep(pipe.getStep()); if ("error".equals(pipe.getPort()) && XProcConstants.p_catch.equals(fromstep.getType())) { catchErrors = true; } else { if (output == null) { fromstep = env.visibleStep(pipe.getStep()); if ("error".equals(pipe.getPort()) && XProcConstants.p_catch.equals(fromstep.getType())) { catchErrors = true;