//Provided by Terren Suydam
package com.jxml.quick.examples.idref;

import java.util.*;
import java.io.*;
import com.jxml.quick.*;
import org.xml.sax.*;
import org.xml.sax.helpers.*;
import com.jxml.protocol.*;

public class Test2
{
  public ChildElemId childElemId;
  public ChildElemRef childElemRef;

  public static void main(String[] args)
  throws Exception
  {
	try
	{
		Protocol.addJXMLProtocolPackage();
	 	QDoc testSchema = Quick.parseSchema(args[0]);
	
		QDoc testDoc2 = Quick.parse( testSchema, "file:test.xml");
		Test test2 = (Test)Quick.getRoot( testDoc2 );
	
		QDoc testDoc3 = Quick.createDoc( test2, testSchema );
		String sXML2 = Quick.express( testDoc3 );
		System.out.println( sXML2 );
	}
	catch (SAXParseException tpe)
	{
		tpe.printStackTrace();
		int line=tpe.getLineNumber();
		if (line!=-1)
		    System.out.println("line="+line);
	}
  }
}