- Object varIf = get("if"); if (varIf != null) undeclare("if");
- if (varIf != null && !"true".equals(varIf)) return;
- } catch (JSExn e) { throw new JSElement.Exn(e); }
+ // FIXME: questionable abuse of namespaces here
+ boolean xturi = "http://xt.ibex.org/".equals(getUri());
+ for(int i=0; i < a.attrSize(); i++) {
+ if (!xturi && !"http://xt.ibex.org/".equals(a.getUri(i))) continue;
+
+ //#switch (a.getKey(i))
+ case "if": if (!"true".equals(eval(a.getVal(i)))) return;
+ case "declare":
+ Object d = eval(a.getVal(i));
+ if (!(d instanceof String)) throw new JSLeaf.Exn(
+ "attribute '"+getPrefix()+":declare' can only contain a "+
+ "space seperated list of variable names to declare.");
+ StringTokenizer st = new StringTokenizer((String)d, " ");
+ while (st.hasMoreTokens()) scope().declare(st.nextToken());
+ continue;
+ //#end
+
+ scope().declare(a.getKey(i));
+ scope().put(a.getKey(i), eval(a.getVal(i)));
+ }
+ } catch (JSExn e) { throw new Exn(e); }