corrected missing filename in debug output
[org.ibex.core.git] / src / org / ibex / Template.java
index edd9334..ec47e7c 100644 (file)
@@ -123,9 +123,9 @@ public class Template {
 
     // XML Parsing /////////////////////////////////////////////////////////////////
 
-    public static Template buildTemplate(InputStream is, Ibex ibex) {
+    public static Template buildTemplate(String sourceName, InputStream is, Ibex ibex) {
         try {
-            return new TemplateHelper(is, ibex).t;
+            return new TemplateHelper(sourceName, is, ibex).t;
         } catch (Exception e) {
             Log.error(Template.class, e);
             return null;
@@ -135,6 +135,7 @@ public class Template {
     /** handles XML parsing; builds a Template tree as it goes */
     static final class TemplateHelper extends XML {
 
+       String sourceName;
         private int state = STATE_INITIAL;
         private static final int STATE_INITIAL = 0;
         private static final int STATE_IN_Ibex_NODE = 1;
@@ -148,7 +149,8 @@ public class Template {
         int meta = 0;
         Ibex ibex;
 
-        public TemplateHelper(InputStream is, Ibex ibex) throws XML.Exn, IOException, JSExn {
+       public TemplateHelper(String sourceName, InputStream is, Ibex ibex) throws XML.Exn, IOException, JSExn {
+            this.sourceName = sourceName;
             this.ibex = ibex;
             parse(new InputStreamReader(is));
             JS staticScript = parseScript(static_content, static_content_start);
@@ -159,7 +161,7 @@ public class Template {
         private JS parseScript(StringBuffer content, int content_start) throws IOException {
             if (content == null) return null;
             String contentString = content.toString();
-            if (contentString.trim().length() > 0) return JS.fromReader("FIXME", content_start, new StringReader(contentString));
+            if (contentString.trim().length() > 0) return JS.fromReader(sourceName, content_start, new StringReader(contentString));
             return null;
         }