fix attribute processing bug, but introduce questionable namespace processing
[org.ibex.xt-crawshaw.git] / src / java / org / ibex / xt / JSElement.java
index 06a6f72..cfa1a1f 100644 (file)
@@ -28,13 +28,17 @@ public class JSElement extends JSScope implements XML.Element {
         for (int i=0; i < c.size(); i++) ((Tree.Leaf)c.get(i)).setParent(this);
     }
 
-    public void out(OutputStream o) throws IOException { throw new UnsupportedOperationException(); }
-    public void out(Writer w) throws IOException {
-        // grab all related attributes
+    public void out(OutputStream o) throws IOException { wrapped.out(o); }
+    public void out(Writer w) throws IOException { wrapped.out(w); }
+
+    /** Load the attributes into the js scope. */
+    protected void loadAttr() {
         try {
             XML.Attributes a = getAttributes();
+            // FIXME: questionable abuse of XML namespaces here
+            boolean xturi = "http://xt.ibex.org/".equals(getUri());
             for(int i=0; i < a.attrSize(); i++) {
-                if (!"http://xt.ibex.org/".equals(a.getUri(i))) continue;
+                if (!xturi && !"http://xt.ibex.org/".equals(a.getUri(i))) continue;
                 declare(a.getKey(i));
                 put(a.getKey(i), eval(a.getVal(i)));
             }