<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

	<xs:simpleType name="Boolean">
		<xs:restriction base="xs:string">
			<xs:enumeration value="true" />
			<xs:enumeration value="yes" />
			<xs:enumeration value="1" />
			<xs:enumeration value="false" />
			<xs:enumeration value="no" />
			<xs:enumeration value="0" />
		</xs:restriction>
	</xs:simpleType><!-- Boolean -->

	<xs:simpleType name="Seconds">
		<xs:restriction base="xs:integer">
			<xs:minInclusive value="1"/>
			<xs:maxInclusive value="3600"/>
		</xs:restriction>
	</xs:simpleType><!-- Seconds -->

	<xs:simpleType name="Number_of_bytes">
		<xs:restriction base="xs:string">
			<xs:minLength value="1"/>
		</xs:restriction>
	</xs:simpleType><!-- Thread_name -->

	<xs:simpleType name="Thread_name">
		<xs:restriction base="xs:string">
			<xs:minLength value="1"/>
			<xs:maxLength value="40"/>
		</xs:restriction>
	</xs:simpleType><!-- Thread_name -->

	<xs:simpleType name="Trace_policy_name">
		<xs:restriction base="xs:string">
			<xs:minLength value="1"/>
			<xs:maxLength value="40"/>
		</xs:restriction>
	</xs:simpleType><!-- Trace_policy_name -->

	<xs:simpleType name="Session_label">
		<xs:restriction base="xs:string">
			<xs:minLength value="1"/>
			<xs:maxLength value="160"/>
		</xs:restriction>
	</xs:simpleType><!-- Session_label -->

	<xs:element name="config">
		<xs:complexType>
			<xs:choice minOccurs="0" maxOccurs="unbounded">

				<xs:element name="policy">
					<xs:complexType>
						<xs:attribute name="label_prefix" type="Session_label" />
						<xs:attribute name="label_suffix" type="Session_label" />
						<xs:attribute name="label"        type="Session_label" />
						<xs:attribute name="thread"       type="Thread_name" />
						<xs:attribute name="buffer"       type="Number_of_bytes" />
						<xs:attribute name="policy"       type="Trace_policy_name" />
					</xs:complexType>
				</xs:element><!-- policy -->

			</xs:choice>
			<xs:attribute name="verbose"               type="Boolean" />
			<xs:attribute name="activity"              type="Boolean" />
			<xs:attribute name="affinity"              type="Boolean" />
			<xs:attribute name="session_arg_buffer"    type="Number_of_bytes" />
			<xs:attribute name="session_ram"           type="Number_of_bytes" />
			<xs:attribute name="session_parent_levels" type="xs:nonNegativeInteger" />
			<xs:attribute name="default_policy"        type="Trace_policy_name" />
			<xs:attribute name="period_sec"            type="Seconds" />
			<xs:attribute name="default_buffer"        type="Number_of_bytes" />
		</xs:complexType>
	</xs:element><!-- config -->

</xs:schema>
