Hi Graydon,
I guess this question didn’t get any response so far:
> How does one go about binding a literal map to an external variable? (I am going to want to do this in a script later; the GUI version is strictly for testing.)
External variable bindings via the GUI are limited to atomic items. If
you use Java for scripting, you could proceed as follows:
import org.basex.core.*;
import org.basex.query.*;
import org.basex.query.value.*;
public class BindMap {
public static void main(String... whatever) throws Exception {
Context ctx = new Context();
String input = "map { 'structure': '/some/path/name' }";
Value map = new QueryProcessor(input, ctx).value();
String query = "declare variable $map external; $map";
QueryProcessor qp = new QueryProcessor(query, ctx);
System.out.println(qp.bind("map", map).value());
}
}
Hope this helps,
Christian