private Option readOption(Step parent, XdmNode node) { checkAttributes(node, new String[] { "name", "required", "select" }, false); String name = node.getAttributeValue(new QName("name")); String required = node.getAttributeValue(new QName("required")); String select = node.getAttributeValue(new QName("select")); String type = node.getAttributeValue(XProcConstants.cx_type); if (name == null) { throw XProcException.staticError(38, node, "Attribute \"name\" required on p:with-option"); } QName oname; if (name.contains(":")) { oname = new QName(name, node); } else { oname = new QName(name); } if (XProcConstants.NS_XPROC.equals(oname.getNamespaceURI())) { throw XProcException.staticError(28, node, "You cannot specify an option in the p: namespace."); } if (required != null && !"false".equals(required) && !"true".equals(required)) { throw XProcException.staticError(19, node, "The required attribute must be 'true' or 'false'."); } Option option = new Option(runtime, node); option.setName(oname); option.setRequired(required); option.setSelect(select); option.setType(type, node); readNamespaceBindings(parent, option, node, select); checkExtensionAttributes(node, option); return option; }
private Option readOption(Step parent, XdmNode node) { checkAttributes(node, new String[] { "name", "required", "select" }, false); String name = node.getAttributeValue(new QName("name")); String required = node.getAttributeValue(new QName("required")); String select = node.getAttributeValue(new QName("select")); String type = node.getAttributeValue(XProcConstants.cx_type); if (name == null) { throw XProcException.staticError(38, node, "Attribute \"name\" required on p:with-option"); } QName oname; if (name.contains(":")) { oname = new QName(name, node); } else { oname = new QName(name); } if (XProcConstants.NS_XPROC.equals(oname.getNamespaceURI())) { throw XProcException.staticError(28, node, "You cannot specify an option in the p: namespace."); } if (required != null && !"false".equals(required) && !"true".equals(required)) { throw XProcException.staticError(19, node, "The required attribute must be 'true' or 'false'."); } Option option = new Option(runtime, node); option.setName(oname); option.setRequired(required); option.setSelect(select); option.setType(type, node); readNamespaceBindings(parent, option, node, select); checkExtensionAttributes(node, option); return option; }
if (!"name".equals(aname.getLocalName())) { Option option = new Option(runtime, node); option.setName(new QName("", aname.getLocalName())); option.setSelect("'" + attr.getStringValue().replace("'", "''") + "'"); option.addNamespaceBinding(new NamespaceBinding(step.getXProc(),node));
if (!"name".equals(aname.getLocalName())) { Option option = new Option(runtime, node); option.setName(new QName("", aname.getLocalName())); option.setSelect("'" + attr.getStringValue().replace("'", "''") + "'"); option.addNamespaceBinding(new NamespaceBinding(step.getXProc(),node));