private Choose readChoose(Step parent, XdmNode node) { checkAttributes(node, new String[] { "name" }, false); String stepName = checkNCName(node.getAttributeValue(_name)); Choose step = new Choose(runtime, node, stepName); checkExtensionAttributes(node, step); step.setParentDecl((DeclareStep) parent); step.parent = parent; Vector<XdmNode> rest = readSignature(step); if (rest == null) { throw XProcException.staticError(15, node, "A p:choose must contain at least one p:when."); } for (XdmNode child : rest) { if (XProcConstants.p_when.equals(child.getNodeName())) { When substep = readWhen(step, child); step.addStep(substep); } else if (XProcConstants.p_otherwise.equals(child.getNodeName())) { Otherwise substep = readOtherwise(step, child); step.addStep(substep); } else { throw new UnsupportedOperationException("Not valid in a choose: " + child.getNodeName()); } } step.checkPrimaryIO(); return step; }
private Choose readChoose(Step parent, XdmNode node) { checkAttributes(node, new String[] { "name" }, false); String stepName = checkNCName(node.getAttributeValue(_name)); Choose step = new Choose(runtime, node, stepName); checkExtensionAttributes(node, step); step.setParentDecl((DeclareStep) parent); step.parent = parent; Vector<XdmNode> rest = readSignature(step); if (rest == null) { throw XProcException.staticError(15, node, "A p:choose must contain at least one p:when."); } for (XdmNode child : rest) { if (XProcConstants.p_when.equals(child.getNodeName())) { When substep = readWhen(step, child); step.addStep(substep); } else if (XProcConstants.p_otherwise.equals(child.getNodeName())) { Otherwise substep = readOtherwise(step, child); step.addStep(substep); } else { throw new UnsupportedOperationException("Not valid in a choose: " + child.getNodeName()); } } step.checkPrimaryIO(); return step; }