// GROSS hack
try {
t.prev = (Template)t.ibex.resolveString(tagname, false).call(null, null, null, null, 9999);
- if (t.prev == null) throw new JSExn("template " + tagname + " not found");
} catch (Exception e) {
Log.error(Template.class, e);
}
if (key != null) {
Hashtable hash = byLength[key.length()];
- hash.put(key, (String)hash.get(key) + processLine(trimmed, false).replaceAll("//[^\"]*$", ""));
+ hash.put(key, (String)hash.get(key) + processLine(trimmed, false).replaceAll("//[^\"]*$", "").trim() + "\n");
} else {
out.print(processLine(trimmed, false));
}
for(int i=0; i<255; i++) {
if (byLength[i] == null) continue;
- out.print("case " + i + ": { switch(ccSwitch"+enumSwitch+".charAt(0)) {\n");
+ out.print("case " + i + ": { switch(ccSwitch"+enumSwitch+".charAt(0)) { ");
buildTrie("", byLength[i]);
- out.print("}; break; }\n");
+ out.print("}; break; } ");
}
out.print("} /* switch */ ");
- if (Default != null) out.print("\n" + Default);
- out.print(" } while(false); //OUTER\n");
+ if (Default != null) out.print(" " + Default);
+ out.print(" } while(false); /* OUTER */\n");
enumSwitch++;
} else {
} else {
out.print("case \'" + prefixPlusOne.charAt(prefixPlusOne.length() - 1) + "\': ");
String code = (String)cases.get(keys.elementAt(i));
- code = code.substring(0, code.length() - 1);
+ code = code.substring(0, code.length());
String key = (String)keys.elementAt(i);
out.print("if (\""+key+"\".equals(ccSwitch"+enumSwitch+")) { if (true) do { " + code + " } while(false); break SUCCESS; } break; ");
}
/** Prefix of current element. Substring of qName. XML Namespace Spec 14-Jan-1999 [7] */
public String getPrefix() { return prefix; }
- public Hash getUriMap() { return urimap; } // HACK
+ // HACK
+ public Hash getUriMap() {
+ Hash map = new Hash();
+ for (Element e = this; e != null; e = e.getParent()) {
+ java.util.Enumeration en = e.urimap.keys();
+ while(en.hasMoreElements()) {
+ String key = (String)en.nextElement();
+ String val = getUri(key);
+ map.put(key, val);
+ }
+ }
+ return map;
+ }
/** URI of current tag. XML Namespace Spec 14-Jan-1999 section 1 */
public String getUri() { return getUri(prefix); }