Removed a couple of testing mains.
[jsvc.git] / src / dolda / jsvc / next / Parser.java
index b896749..962dc85 100644 (file)
@@ -36,16 +36,6 @@ public class Parser {
        return(doc.createElementNS(null, name));
     }
     
-    protected Attr makeattr(Document doc, Element el, String name, String val) {
-       Attr a = doc.createAttributeNS(el.getNamespaceURI(), name);
-       a.setValue(val);
-       return(a);
-    }
-
-    protected Attr makeattr(Document doc, Element el, String name) {
-       return(doc.createAttributeNS(el.getNamespaceURI(), name));
-    }
-
     protected String name(State s) throws IOException {
        StringBuilder buf = new StringBuilder();
        while(true) {
@@ -75,7 +65,7 @@ public class Parser {
     }
 
     protected Attr attribute(State s, Element el) throws IOException {
-       String nm = name(s);
+       Attr a = s.doc.createAttributeNS(null, name(s));
        s.in.peek(true);
        int c = s.in.read();
        if(c != '=')
@@ -98,7 +88,8 @@ public class Parser {
                buf.append((char)s.in.read());
            }
        }
-       return(makeattr(s.doc, el, nm, buf.toString()));
+       a.setValue(buf.toString());
+       return(a);
     }
     
     protected Element element(State s) throws IOException {
@@ -231,15 +222,4 @@ public class Parser {
            return(String.format("\\%03o", (int)c));
        return(Character.toString((char)c));
     }
-
-    public static void main(String[] args) throws Exception {
-       Parser p = new Parser();
-       DocumentFragment f = p.parse(new FileReader(args[0]));
-       javax.xml.transform.TransformerFactory fac = javax.xml.transform.TransformerFactory.newInstance();
-       fac.setAttribute("indent-number", 2);
-       javax.xml.transform.Transformer t = fac.newTransformer();
-       t.setOutputProperty(javax.xml.transform.OutputKeys.INDENT, "yes");
-       t.transform(new javax.xml.transform.dom.DOMSource(f), new javax.xml.transform.stream.StreamResult(System.out));
-       System.out.println(t.getClass());
-    }
 }