@Override
 public void declareNamespace(final String prefix, final String uri) throws XQException {
   try {
     BXQAbstract.valid(prefix, String.class);
     BXQAbstract.valid(uri, String.class);
     final QNm name = new QNm(token(prefix), token(uri));
     if (!uri.isEmpty()) ctx.ns.add(name, null);
     else ctx.ns.delete(name);
   } catch (final QueryException ex) {
     throw new BXQException(ex);
   }
 }
 @Override
 public String getNamespaceURI(final String prefix) throws XQException {
   BXQAbstract.valid(prefix, String.class);
   final byte[] uri = ctx.ns.find(token(prefix));
   if (uri != null) return string(uri);
   throw new BXQException(PRE, prefix);
 }
 @Override
 public void setDefaultFunctionNamespace(final String uri) throws XQException {
   BXQAbstract.valid(uri, String.class);
   ctx.nsFunc = token(uri);
 }
 @Override
 public void setDefaultElementTypeNamespace(final String uri) throws XQException {
   BXQAbstract.valid(uri, String.class);
   ctx.nsElem = token(uri);
 }
 @Override
 public void setDefaultCollation(final String uri) throws XQException {
   BXQAbstract.valid(uri, String.class);
   ctx.collation = Uri.uri(token(uri));
 }
 @Override
 public void setBaseURI(final String baseUri) throws XQException {
   BXQAbstract.valid(baseUri, String.class);
   ctx.baseURI = Uri.uri(token(baseUri));
 }