2004/01/17 22:54:24
authormegacz <megacz@xwt.org>
Fri, 30 Jan 2004 07:44:47 +0000 (07:44 +0000)
committermegacz <megacz@xwt.org>
Fri, 30 Jan 2004 07:44:47 +0000 (07:44 +0000)
darcs-hash:20040130074447-2ba56-12f8501313c6e1d1c85702dd6c4f13761a75cf2c.gz

src/org/xwt/Template.java

index ba1c4ee..53f449a 100644 (file)
@@ -68,13 +68,10 @@ public class Template {
     }
 
     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) {
@@ -124,9 +121,8 @@ public class Template {
 
         if (id != null) parentPis.putDollar(id, b);
         for(int i=0; i<preapply.size(); i++) {
-            Template t = new Template(Stream.getInputStream(resolveStringToResource((String)preapply.elementAt(i), xwt, false)), xwt);
-            if (t == null) throw new RuntimeException("unable to resolve resource " + preapply.elementAt(i));
-            t.apply(b);
+            JS templateFunc = resolveStringToResource((String)preapply.elementAt(i), xwt, false);
+            templateFunc.call(b, null, null, null, 1);
         }
 
         PerInstantiationJSScope pis = new PerInstantiationJSScope(b, xwt, parentPis, staticScope);