public boolean valid(Environment env) { boolean valid = true; if (bindings.size() > 1) { error("Variables can have at most one binding.", XProcConstants.dynamicError(8)); valid = false; } if (select == null) { error("You must specify select on variable.", XProcConstants.staticError(16)); } return valid; }
protected void dump(int depth) { String indent = ""; for (int count = 0; count < depth; count++) { indent += " "; } logger.trace(indent + "variable " + getName()); if (getBinding().size() == 0) { logger.trace(indent + " no binding"); } for (Binding binding : getBinding()) { binding.dump(depth+2); } } }
private Variable readVariable(Step parent, XdmNode node) { checkAttributes(node, new String[] { "name", "select" }, false); String name = node.getAttributeValue(new QName("name")); String select = node.getAttributeValue(new QName("select")); QName oname = new QName(name, node); // If it has no prefix, then it's in no namespace, not the default namespace if (oname.getPrefix() == null || "".equals(oname.getPrefix())) { oname = new QName("", name); } if (XProcConstants.NS_XPROC.equals(oname.getNamespaceURI())) { throw XProcException.staticError(28, node, "You cannot specify a variable in the p: namespace."); } Variable variable = new Variable(runtime, node); variable.setName(oname); variable.setSelect(select); readNamespaceBindings(parent, variable, node, select); checkExtensionAttributes(node, variable); return variable; }
@Override public void checkVariables() { for (Variable variable : variables) { for (Binding binding : variable.getBinding()) { if (binding.getBindingType() == Binding.PIPE_NAME_BINDING) { PipeNameBinding pipe = (PipeNameBinding) binding; String name = pipe.getStep(); boolean ancestor = false; Step step = this; while (step != null && !ancestor) { ancestor = name.equals(step.getName()); step = step.parent; } if (!ancestor) { logger.trace(MessageFormatter.nodeMessage(node, getName() + " variable depends on " + pipe.getStep())); addDependency(pipe.getStep()); } } } } }
var.dump(depth+2);
private Variable readVariable(Step parent, XdmNode node) { checkAttributes(node, new String[] { "name", "select" }, false); String name = node.getAttributeValue(new QName("name")); String select = node.getAttributeValue(new QName("select")); QName oname = new QName(name, node); // If it has no prefix, then it's in no namespace, not the default namespace if (oname.getPrefix() == null || "".equals(oname.getPrefix())) { oname = new QName("", name); } if (XProcConstants.NS_XPROC.equals(oname.getNamespaceURI())) { throw XProcException.staticError(28, node, "You cannot specify a variable in the p: namespace."); } Variable variable = new Variable(runtime, node); variable.setName(oname); variable.setSelect(select); readNamespaceBindings(parent, variable, node, select); checkExtensionAttributes(node, variable); return variable; }
@Override public void checkVariables() { for (Variable variable : variables) { for (Binding binding : variable.getBinding()) { if (binding.getBindingType() == Binding.PIPE_NAME_BINDING) { PipeNameBinding pipe = (PipeNameBinding) binding; String name = pipe.getStep(); boolean ancestor = false; Step step = this; while (step != null && !ancestor) { ancestor = name.equals(step.getName()); step = step.parent; } if (!ancestor) { logger.trace(MessageFormatter.nodeMessage(node, getName() + " variable depends on " + pipe.getStep())); addDependency(pipe.getStep()); } } } } }
var.dump(depth+2);
protected void dump(int depth) { String indent = ""; for (int count = 0; count < depth; count++) { indent += " "; } logger.trace(indent + "variable " + getName()); if (getBinding().size() == 0) { logger.trace(indent + " no binding"); } for (Binding binding : getBinding()) { binding.dump(depth+2); } } }
public boolean valid(Environment env) { boolean valid = true; if (bindings.size() > 1) { error("Variables can have at most one binding.", XProcConstants.dynamicError(8)); valid = false; } if (select == null) { error("You must specify select on variable.", XProcConstants.staticError(16)); } return valid; }
for (Variable var : step.getVariables()) { RuntimeValue value = computeValue(var); inScopeOptions.put(var.getName(), value);
for (Variable var : step.getVariables()) { RuntimeValue value = computeValue(var); inScopeOptions.put(var.getName(), value);
inScopeOptions.put(var.getName(), value);
for (Variable var : step.getVariables()) { RuntimeValue value = computeValue(var); inScopeOptions.put(var.getName(), value);