package com.jxml.quick.examples.list;

import java.io.*;
import java.util.*;
import com.jxml.protocol.*;
import com.jxml.quick.*;

// Import classes for the SAX Parser
import org.xml.sax.*;

public class Main
{
    public static void main(String[] args)
    {
	try
	    {
		Protocol.addJXMLProtocolPackage();
		// Generate a Quick schema
		QDoc listSchema=CreateTest.createSchema();

		// Process the XML document
		QDoc doc=Quick.parse(listSchema,"file:sample.list");

		// Get a reference to the root element contained within
		// the QDoc object, thereby obtaining a reference to the
		// "tree" structure itself. Iterate through the elements
		// in the tree, displaying each to output.
		ArrayList list=(ArrayList)Quick.getRoot(doc);
		int s=list.size();
		int i;
		for (i=0;i<s;++i)
		    {
			System.out.println(list.get(i));
		    }
	    } 
	catch (Exception e)
	    {
		QPE.display(e);
	    }
    }
}
