- public Template(InputStream is, XWT xwt) {
- this.xwt = xwt;
- try {
- new TemplateHelper().parseit(is, this);
- } catch (Exception e) {
- throw new RuntimeException(e.toString());
- }
- }
-
- public Template(XWT xwt) {
- this.xwt = xwt;
- }
-
- public static JS resolveStringToResource(String str, XWT xwt, boolean permitAbsolute) throws JSExn {
- // URL
- /* FIXME
- if (str.indexOf("://") != -1) {
- if (permitAbsolute) return (Stream)xwt.url2res(str);
- throw new JSExn("absolute URL " + str + " not permitted here");
- }
- */
- // root-relative
- JS ret = (JS)xwt.getAndTriggerTraps("");
- while(str.indexOf('.') != -1) {
- String path = str.substring(0, str.indexOf('.'));
- str = str.substring(str.indexOf('.') + 1);
- ret = (JS)ret.get(path);
- }
- ret = (JS)ret.get(str);
- return ret;
- }
-
+ // for non-root nodes
+ private Template(Template t, int startLine) { prev = t; this.xwt = t.xwt; this.startLine = startLine; }
+ private Template(XWT xwt) { this.xwt = xwt; }
+