html parser fix + small fix in comment list page
[mir.git] / source / mir / generator / tal / TALTest.java
index cbc89fe..d78372a 100755 (executable)
 
 package mir.generator.tal;
 
-import java.io.*;
+import java.io.File;
 import java.util.HashMap;
-import java.util.*;
-import mir.generator.tal.interfaces.*;
-import mir.util.xml.html.*;
+import java.util.Map;
 
 public class TALTest {
   public static void main(String args[]) {
@@ -44,64 +42,7 @@ public class TALTest {
       Map test = new HashMap();
       test.put("name", "zapata");
 
-      HTMLParser parser2 = new HTMLParser();
-/*
-      parser2.parse(new StringReader("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">  <div><b><a href=bla>blaat</div>"),
-          new HTMLParser.ParserReceiver() {
-
-        public void dtd(String aDTD) {
-          System.out.println(aDTD);
-        }
-
-        public void openTag(String aTag, Map anAttributes) {
-
-          System.out.print("<"+aTag);
-          Iterator i = anAttributes.entrySet().iterator();
-          while (i.hasNext()) {
-            Map.Entry entry = (Map.Entry) i.next();
-
-            System.out.print(" " + entry.getKey() + "=\"" + entry.getValue()+"\"");
-          }
-          System.out.print(">");
-        }
-
-        public void closeTag(String aTag) {
-          System.out.print("</"+aTag+">");
-        }
-
-        public void comment(String aData) {
-        }
-
-        public void cdata(String aData) {
-          System.out.print(aData);
-        }
-      }
-          );
-*/
-String doc =
-" <!DOCTYPE some doc type>" +
-"  <head tal:on-error=\"exception.message\">"+
-"    <title tal:content=\"lang('posting.htmltitle')\"/>"+
-"    <meta name=\"description\" tal:attributes=\"content lang('posting.meta.description')\">"+
-"    <meta name=\"author\" content=\"${lang(\"posting.meta.author\")}\">"+
-"    <meta name=\"keywords\" content=\"${lang(\"posting.meta.keywords\")}\">"+
-"    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=${config['Mir.DefaultHTMLCharset']}\">"+
-"    <meta name=\"robots\" content=\"index\">"+
-"    <meta name=\"robots\" content=\"follow\">"+
-"    <link rel=stylesheet type=\"text/css\" href=\"${config['Producer.ProductionHost']}/style/formate.css\">"+
-"  </head>"+
-"  <body bgcolor=\"white\" text=\"black\" link=\"#006600\" vlink=\"#006600\" alink=\"Red\" tal:on-error='exception.message'>"+
-"  </body>"+
-"</html>";
-      System.out.println(doc);
-      TALTemplate template = parser.parse(doc, expressionParser);
-
-
-//          <td tal:on-error='exception.message'><tal:test tal:content='name.bla'></tal:test><h1 tal:content=\"name\">test</h1></TD>", expressionParser);
-      PrintWriter o = new PrintWriter(System.out);
-      template.processTemplate(test, o, new TALLogger.TALSystemOutLogger());
-      o.close();
-
+      TALTemplate template = parser.parse(new File("m:/biotechdev/mir/etc/producertal/startpage.template"), expressionParser);
     }
     catch (Throwable t) {
       System.out.println("Exception: " + t.toString());