private Vec children = new Vec(); ///< during XML parsing, this holds the list of currently-parsed children; null otherwise
private JS script = null; ///< the script on this node
Template prev;
+ Template prev2;
JSScope staticScope = null; ///< the scope in which the static block is executed
private void apply(Box b, PerInstantiationScope parentPis) throws JSExn, IOException {
if (prev != null) prev.apply(b, null);
+ if (prev2 != null) prev2.apply(b, null);
// FIXME this dollar stuff is all wrong
if (id != null) parentPis.putDollar(id, b);
PerInstantiationScope pis = new PerInstantiationScope(b, ibex, parentPis, staticScope);
for(int i=0; i<urikeys.length; i++) {
+ if (urikeys[i] == null) continue;
pis.declare(urikeys[i]);
pis.put(urikeys[i], ibex.resolveString(urivals[i], true));
}
InputStream is = Stream.getInputStream(s);
Ibex.Blessing b = Ibex.Blessing.getBlessing(s).parent;
while(b != null) {
- initial_uri = (b.parentkey == null ? "" : (b.parentkey + ".")) + initial_uri;
+ if(b.parentkey != null) initial_uri = b.parentkey + (initial_uri.equals("") ? "" : "." + initial_uri);
b = b.parent;
}
parse(new InputStreamReader(is));
throw new XML.Exn("root element was not <ibex>", XML.Exn.SCHEMA, getLine(), getCol());
if (c.getAttrLen() != 0)
throw new XML.Exn("root element must not have attributes", XML.Exn.SCHEMA, getLine(), getCol());
- if (c.getUri("ui") == null) c.addUri("ui", "ibex://ui");
- if (c.getUri("") == null) c.addUri("", initial_uri);
+ if (c.getUri("ui") == null || "".equals(c.getUri("ui"))) c.addUri("ui", "ibex://ui");
+ if (c.getUri("meta") == null || "".equals(c.getUri("meta"))) c.addUri("meta", "ibex://meta");
+ if (c.getUri("") == null || "".equals(c.getUri(""))) c.addUri("", initial_uri);
state = STATE_IN_ROOT_NODE;
return;
case STATE_IN_ROOT_NODE:
String tagname = (c.getUri().equals("") ? "" : (c.getUri() + ".")) + c.getLocalName();
// GROSS hack
try {
- t.prev = (Template)t.ibex.resolveString(tagname, false).call(null, null, null, null, 9999);
+ // GROSSER hack
+ t.prev2 = (Template)t.ibex.resolveString(tagname, false).call(null, null, null, null, 9999);
} catch (Exception e) {
Log.error(Template.class, e);
}
while(uriEnumeration.hasMoreElements()) {
String key = (String)uriEnumeration.nextElement();
String val = (String)urimap.get(key);
+ if (val.equals("ibex://ui")) continue;
+ if (val.equals("ibex://meta")) continue;
t.urikeys[ii] = key;
- if (val.charAt(0) == '.') val = val.substring(1);
+ if (val.length() > 0 && val.charAt(0) == '.') val = val.substring(1);
t.urivals[ii] = val;
ii++;
}