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 QCQJML extends OCMrootPeerSupport
{
	/**
	 * User-provided code to perform the conversion.
	 */
	public void cvt(Object param)
		throws SAXException, IOException
	{
		int i,s;

		QMQJML dm=(QMQJML)dataModel;

		dm.init(); // initialize the data model

		addStringAttribute("PUBLIC",dm.PUBLIC);
		addStringAttribute("SYSTEM",dm.SYSTEM);
		startElement("qiml");

		if ("".equals(dm.root))
			throw new SAXException("qjml requires root attribute");
		Object rootCoin=dm.coinMap.get(dm.root);
		if (rootCoin==null)
			throw new SAXException("Undefined coin: "+dm.root);
		doCvt(rootCoin,null); // null: element conversion

		endElement("qiml");
	}
}
