package com.jxml.quick.examples.href2;

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 Main1
{
    public static void main(String[] args)
    {
	try
	    {
		Protocol.addJXMLProtocolPackage();
		QDoc schema=CreateTest.createSchema();

		ArrayList root=new ArrayList();		   // create object structure
		ArrayList root1=new ArrayList();
		ArrayList node=new ArrayList();
		ArrayList node1=new ArrayList();
		root.add(root);
		root.add(root1);
		root.add(node);
		root.add(node1);
		root1.add(root);
		root1.add(root1);
		root1.add(node);
		root1.add(node1);

		QDoc doc=Quick.createDoc("file:text.xml",root,schema);
		QDoc doc1=Quick.createDoc("file:text1.xml",root1,schema);

		doc1.getId(node1);				// force node 1 to be part of doc1

		System.out.println();
		System.out.println("text.xml:");
		System.out.println();
		System.out.println(Quick.express(doc));			   // display structure as XML

		System.out.println();
		System.out.println("text1.xml:");
		System.out.println();
		System.out.println(Quick.express(doc1));
	    } 
	catch (Exception e)
	    {
		QPE.display(e);
	    }
    }
}
