//Provided by Dave Watt
package com.jxml.quick.examples.content2;
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 Test
{

  public Test()
  {
  }

  public ArrayList listField = new ArrayList();
  public ArrayList secondList = new ArrayList();

  public ChildElemId childElemId;
  public ChildElemRef childElemRef;
  public ChildElemId2 childElemId2;

  public static void main(String[] args)
  throws Exception
  {
    Protocol.addJXMLProtocolPackage();
    Test vTest = new Test();
    vTest.invokedStandalone = true;
 	QDoc testSchema = CreateTest.createSchema();
    vTest.childElemId = new ChildElemId();
    vTest.childElemId2 = new ChildElemId2();
	vTest.childElemRef = new ChildElemRef();
    vTest.childElemRef.elem = vTest.childElemId;
  vTest.listField.add( vTest.childElemId );
  vTest.listField.add( vTest.childElemRef );
  vTest.secondList.add( new ChildElemId3() );
  vTest.secondList.add( new ChildElemId2() );
  vTest.secondList.add( new ChildElemId3() );
	QDoc testDoc = Quick.createDoc( vTest, testSchema );
	String sXml = Quick.express( testDoc );
	System.out.println( sXml );
	QDoc testDoc2 = Quick.parseString( testSchema, sXml );
	Test test2 = (Test)Quick.getRoot( testDoc2 );
	QDoc testDoc3 = Quick.createDoc( test2, testSchema );
	String sXML2 = Quick.express( testDoc3 );
	System.out.println( sXML2 );
  }
  private boolean invokedStandalone = false;
}