// A hacky routine used by VisitNode and RecurseNode
TemplateSequenceModel evaluateStringsToNamespaces(Environment env) throws TemplateException {
TemplateSequenceModel val = (TemplateSequenceModel) eval(env);
SimpleSequence result = new SimpleSequence(val.size());
for (int i=0; i<items.size(); i++) {
Object itemExpr = items.get(i);
if (itemExpr instanceof StringLiteral) {
String s = ((StringLiteral) itemExpr).getAsString();
try {
Environment.Namespace ns = env.importLib(s, null);
result.add(ns);
}
catch (IOException ioe) {
throw new _MiscTemplateException(((StringLiteral) itemExpr), new Object[] {
"Couldn't import library ", new _DelayedJQuote(s), ": ",
new _DelayedGetMessage(ioe) });
}
}
else {
result.add(val.get(i));
}
}
return result;
}