return list.iterator();
}
public TailCall processLeavingTail(XPathContext context) throws XPathException {
Controller controller = context.getController();
String prefix = name.evaluateAsString(context);
if (!(prefix.equals("") || XMLChar.isValidNCName(prefix))) {
DynamicError err = new DynamicError("Namespace prefix is invalid: " + prefix, this);
err.setErrorCode("XT0920");
err.setXPathContext(context);
context.getController().recoverableError(err);
return null;
}
if (prefix.equals("xml") || prefix.equals("xmlns")) {
DynamicError err = new DynamicError("Namespace prefix '" + prefix + "' is not allowed", this);
err.setErrorCode("XT0920");
err.setXPathContext(context);
context.getController().recoverableError(err);
return null;
}
String uri = expandChildren(context).toString();
if (uri.equals("")) {
DynamicError err = new DynamicError("Namespace URI is an empty string", this);
err.setErrorCode("XT0930");
err.setXPathContext(context);
context.getController().recoverableError(err);
return null;
}
int nscode = controller.getNamePool().allocateNamespaceCode(prefix, uri);
SequenceReceiver out = context.getReceiver();
out.namespace(nscode, ReceiverOptions.REJECT_DUPLICATES);
return null;
}