<?xml version="1.0" encoding="UTF-8"?>
<rmml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="R:\collaborative-nir\program\Cscl3DWS\rmml\RMML.xsd">
	<composition name="CKMParser">
		<xml name="engine"/>
		<script src="kmlab.mjs"/>
		<script><![CDATA[
			this.lab = new CKMLab();

			function load_xml(src)
			{
				this.engine.src = src;
				if( this.engine.XMLDocument.firstChild == null)
				{
					return;
				}
				var children=this.engine.XMLDocument.firstChild.childNodes;
				var len=children.length;
				for(var ii=0; ii<len; ii++)
				{
					item=children.item(ii);
					if( item.nodeName == null)	continue;
					else	if( item.nodeName == "elements")
					{
						loadElements(item);
					}
					else	if( item.nodeName == "ui")
					{
						loadUI(item);
					}
				}
			}

			function loadElements(node)
			{
				var children=node.childNodes;
				if (children == null) return null;
				var len=children.length;
				var ii=0;
				for(ii=0; ii<len; ii++)
				{
					var child=children.item(ii);
					var _type = child.getAttribute('type');
					if( _type==null || typeof(_type)==undefined)	continue;
					this.lab.elements.push(_type);
				}
			}

			function loadUI(node)
			{
				var children=node.childNodes;
				if (children == null) return null;
				var len=children.length;
				var ii=0;
				for(ii=0; ii<len; ii++)
				{
					var child=children.item(ii);
					var type = child.getAttribute('name');
					if( type==null || typeof(type)==undefined)	continue;
					this.lab.buttons.push(type);
				}
			}
		]]></script>
	</composition>
</rmml>