package com.jxml.quick.util.qjml2qiml;
import com.jxml.quick.model.qjml.*;
import com.jxml.quick.*;
import org.xml.sax.*;
import java.util.*;
import com.jxml.quick.ocm.*;
import java.io.*;

/**
 * Extracts QJML data.
 */
public class QCSequence extends OCMpeerSupport
{
	public boolean beenHere=false;

	/**
	 * User-provided code to perform the conversion.
	 */
	public void cvt(Object param)
		throws SAXException, IOException
	{
		QMSequence dm=(QMSequence)dataModel;

		if (beenHere)
		{
			addStringAttribute("href","#"+dm.label);
			//addStringAttribute("schema","http://www.jxml.com/qiml.qiml");
			emptyElement("clink");
			return;
		}
		if (!"".equals(dm.label))
			beenHere=true;

		addStringAttribute("ID",dm.label);
		addBooleanAttribute("optional",dm.optional);
		addBooleanAttribute("repeating",dm.repeating);

		startElement("childSequence");

		doCvt(dm.access,null);
		doCvt(dm.contentList,null);

		endElement("childSequence");
	}
}
