fix attribute processing bug, but introduce questionable namespace processing
[org.ibex.xt-crawshaw.git] / src / java / org / ibex / xt / Template.java
index c9b8611..445a6ee 100644 (file)
@@ -59,8 +59,10 @@ public class Template extends JSElement {
 
         XML.Attributes a = e.getAttributes();
         for (int i=0; i < a.attrSize(); i++) {
-            if ("if".equals(a.getKey(i)) &&
-                "http://xt.ibex.org/".equals(a.getUri(i))) {
+            // FIXME: questionable abuse of XML namespaces here
+            if ("if".equals(a.getKey(i)) && (
+                "http://xt.ibex.org/".equals(e.getUri()) ||
+                "http://xt.ibex.org/".equals(a.getUri(i)))) {
                 e = new Template.IfWrap(e);
             }
         }
@@ -99,7 +101,7 @@ public class Template extends JSElement {
 
             try {
                 Object varIf = get("if"); if (varIf != null) undeclare("if");
-                if (varIf != null && !Boolean.getBoolean((String)varIf)) return;
+                if (varIf != null && !"true".equals(varIf)) return;
             } catch (JSExn e) { throw new RuntimeException(e); }
 
             wrapped.out(w);