package com.jxml.quick.examples.types;

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 schema=CreateTest.createSchema();

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

		// Display the various fields of the root object 
		Types t=(Types)Quick.getRoot(doc);
		System.out.println("i="+t.i);
		System.out.println("b="+t.b);
		System.out.println("f="+t.f);
		System.out.println("s="+t.s);
		int bl=t.bin.length;
		int ii;
		System.out.println("bin length="+bl);
		for (ii=0;ii<bl;++ii)
			System.out.println("    "+t.bin[ii]);
		System.out.println("url="+t.url);
		System.out.println("c="+t.c);
		System.out.println("bd="+t.bd);
	    } 
	catch (Exception e)
	    {
		QPE.display(e);
	    }
    }
}
