/*
 * MIDBench.java
 *
 * Created on February 26, 2003, 4:07 PM
 */

package MIDBench;

import java.io.*;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

import com.alsutton.xmlparser.*;
import com.alsutton.xmlparser.objectmodel.*;

/**
 *
 * @author  Administrator
 * @version
 */
public class MIDBenchAlSuttonsdeep extends javax.microedition.midlet.MIDlet {

    private static void testAlSuttons(String s) throws IOException {
        ByteArrayInputStream bin = 
            new ByteArrayInputStream(s.getBytes());        
        TreeBuilder tb = new TreeBuilder();
        com.alsutton.xmlparser.objectmodel.Node xmlModel = tb.createTree(new InputStreamReader(bin));
    }
    
    private Form form;
    public void startApp() {
        String output = "Parsing done!";
        try {
            for (int i = 0; i < 5; i++ ) {
        testAlSuttons("<sometag depth=\"0\">\n" +
                 "  <sometag depth=\"1\">\n" +
                 "    <sometag depth=\"2\">\n" +
                 "      <sometag depth=\"3\">\n" +
                 "        <sometag depth=\"4\">\n" +
                 "          <sometag depth=\"5\">\n" +
                 "            <sometag depth=\"6\">\n" +
                 "              <sometag depth=\"7\">\n" +
                 "                <sometag depth=\"8\">\n" +
                 "                  <sometag depth=\"9\">\n" +
                 "                    <sometag depth=\"10\">\n" +
                 "                      No more\n" +
                 "                    </sometag>\n" +
                 "                  </sometag>\n" +
                 "                </sometag>\n" +
                 "              </sometag>\n" +
                 "            </sometag>\n" +
                 "          </sometag>\n" +
                 "        </sometag>\n" +
                 "      </sometag>\n" +
                 "    </sometag>\n" +
                 "  </sometag>\n" +
                 "</sometag>\n");
            }
        } catch (Exception e) {
            output = "Parsing failed!";
        }
        form = new Form("Done");
        form.append(new StringItem(null, output));
        Display.getDisplay(this).setCurrent(form);
    }
    
    public void pauseApp() {
    }
    
    public void destroyApp(boolean unconditional) {
    }
}
