<?xml version="1.0" encoding="UTF-8"?>
<!--
    Company :   Structured Software Systems Ltd
    Version :   1.0
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified"
    targetNamespace="http://www.threesl.com/cradlexml/1-0"
    xmlns:cradle="http://www.threesl.com/cradlexml/1-0"
    version="1.0">

	<!-- Category Types -->
	<xs:simpleType name="categoryType">
		<xs:annotation>
			<xs:documentation>
				Item's Category Type.
			</xs:documentation>
		</xs:annotation>

		<xs:restriction base="xs:normalizedString">
			<xs:enumeration value="single" />
			<xs:enumeration value="multi" />
		</xs:restriction>
	</xs:simpleType>

    <!-- CM item's Type attribute. -->
    <xs:simpleType name="cmItemType">
        <xs:annotation>
            <xs:documentation xml:lang="en-gb">
                Item's Type as used in CM, choice of one of the predefined types.
            </xs:documentation>
        </xs:annotation>

        <xs:restriction base="xs:normalizedString">
            <xs:enumeration value="CMS_CHANGE_REQMNT"></xs:enumeration>
            <xs:enumeration value="CMS_CHANGE_SPEC"></xs:enumeration>
            <xs:enumeration value="CMS_CHANGE_EVENT"></xs:enumeration>
            <xs:enumeration value="CMS_CHANGE_DIAG"></xs:enumeration>
            <xs:enumeration value="CMS_CHANGE_DDENT"></xs:enumeration>
            <xs:enumeration value="CMS_CHANGE_NOTE"></xs:enumeration>
            <xs:enumeration value="? CHANGE_INFO ?"></xs:enumeration>
        </xs:restriction>
    </xs:simpleType>

	<!-- Diagram's Type attribute. -->
	<xs:simpleType name="diagramType">
		<xs:annotation>
			<xs:documentation xml:lang="en-gb">
				Diagram's Type, choice of one of the predefined types.
			</xs:documentation>
		</xs:annotation>

		<xs:restriction base="xs:normalizedString">
			<xs:enumeration value="DFD" />
			<xs:enumeration value="ERD" />
			<xs:enumeration value="STD" />
			<xs:enumeration value="STC" />
			<xs:enumeration value="DSD" />
			<xs:enumeration value="PAD" />
			<xs:enumeration value="FBD" />
			<xs:enumeration value="BD" />
			<xs:enumeration value="BD" />
			<xs:enumeration value="UCD" />
			<xs:enumeration value="PD" />
			<xs:enumeration value="COD" />
			<xs:enumeration value="SQD" />
			<xs:enumeration value="CD" />
			<xs:enumeration value="SCD" />
			<xs:enumeration value="ACD" />
			<xs:enumeration value="CPD" />
			<xs:enumeration value="DPD" />
			<xs:enumeration value="PFD" />
			<xs:enumeration value="HID" />
			<xs:enumeration value="IDF" />
			<xs:enumeration value="AID" />
			<xs:enumeration value="SAD" />
		    <xs:enumeration value="NULL" /> <!-- Added so type does not need to be redifined for CHT_DETAIL: means empty -->
		</xs:restriction>
	</xs:simpleType>

	<!-- Item's Type attribute. -->
    <xs:simpleType name="itemType">
		<xs:annotation>
			<xs:documentation xml:lang="en-gb">
				Item's Type, choice of one of the predefined types.
			</xs:documentation>
		</xs:annotation>

		<xs:restriction base="xs:normalizedString">
            <xs:enumeration value="INFO_REQUIREMENT"></xs:enumeration>
            <xs:enumeration value="INFO_SPECIFICATION"></xs:enumeration>
            <xs:enumeration value="INFO_EVENT"></xs:enumeration>
            <xs:enumeration value="INFO_DIAGRAM"></xs:enumeration>
            <xs:enumeration value="INFO_DD_ENTRY"></xs:enumeration>
            <xs:enumeration value="INFO_NOTE"></xs:enumeration>
            <xs:enumeration value="INFO_BASELINE"></xs:enumeration>
            <xs:enumeration value="INFO_CHR"></xs:enumeration>
            <xs:enumeration value="INFO_CHT"></xs:enumeration>
            <xs:enumeration value="INFO_ENVLOAD"></xs:enumeration>
            <xs:enumeration value="INFO_ENVCOND"></xs:enumeration>
            <xs:enumeration value="INFO_THREAD"></xs:enumeration>
            <xs:enumeration value="INFO_IPCOND"></xs:enumeration>
            <xs:enumeration value="INFO_CMLOG"></xs:enumeration>
            <xs:enumeration value="INFO_STMOD"></xs:enumeration>
		    <xs:enumeration value="INFO_APPROVAL"></xs:enumeration>
		    <xs:enumeration value="INFO_LOADSCEN"></xs:enumeration>
        </xs:restriction>
    </xs:simpleType>

	<!-- TBD: Check these are not used and remove -->
    <xs:attribute name="cradle_type" type="cradle:itemType" />
    <xs:attribute name="cradle_subtype" type="xs:normalizedString" />
    <xs:attribute name="name" type="xs:normalizedString" />
    <xs:attribute name="number" type="xs:integer" />
    <xs:attribute name="author" type="xs:normalizedString" />

	<!-- Item's Domain attribute. -->
	<xs:simpleType name="domain">
		<xs:annotation>
			<xs:documentation xml:lang="en-gb">
				Item's Domain attribute. "E"ssential or "I"mplementation.
			</xs:documentation>
		</xs:annotation>

		<xs:restriction base="xs:string">
			<xs:enumeration value="E" />
			<xs:enumeration value="I" />
			<xs:enumeration value="X" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Item's Draftattribute. -->
	<xs:simpleType name="itemDraft">
		<xs:annotation>
			<xs:documentation xml:lang="en-gb">
				Item's draft, with maximum 1 capital letter..
			</xs:documentation>
		</xs:annotation>

		<xs:restriction base="xs:string">
			<xs:maxLength value="1" />
			<xs:pattern value="[A-Z]{0,1}" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Item's Name attribute. -->
	<xs:simpleType name="itemName">
		<xs:annotation>
			<xs:documentation xml:lang="en-gb">
				Item's name, with maximum length of 60 bytes after decoding.
			</xs:documentation>
		</xs:annotation>

		<xs:restriction base="xs:string">
			<xs:maxLength value="60" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Item's Key attribute. -->
	<xs:simpleType name="itemKey">
		<xs:annotation>
			<xs:documentation xml:lang="en-gb">
				Item's key, with maximum length of 60 bytes after decoding.
			</xs:documentation>
		</xs:annotation>

		<xs:restriction base="xs:string">
			<xs:maxLength value="60" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Item's Number attribute. -->
	<xs:simpleType name="itemNumber">
		<xs:annotation>
			<xs:documentation xml:lang="en-gb">
				Item's number, with maximum length of 60 bytes after decoding.
			</xs:documentation>
		</xs:annotation>

		<xs:restriction base="xs:string">
		    <xs:minLength value="0" />
			<xs:maxLength value="60" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Item's Note Type attribute. -->
	<xs:simpleType name="noteType">
		<xs:annotation>
			<xs:documentation xml:lang="en-gb">
				Item's Note Type, with maximum length of 16 bytes after decoding.
			</xs:documentation>
		</xs:annotation>

		<xs:restriction base="xs:string">
			<xs:maxLength value="16" />
		</xs:restriction>
	</xs:simpleType>

	<!-- PDUID. -->
	<xs:simpleType name="PDUID">
		<xs:annotation>
			<xs:documentation xml:lang="en-gb">
				PDUID, with maximum length of 26 bytes after decoding.
			</xs:documentation>
		</xs:annotation>

		<xs:restriction base="xs:string">
			<xs:maxLength value="26" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Skill's name. -->
	<xs:simpleType name="skillName">
		<xs:annotation>
			<xs:documentation xml:lang="en-gb">
				Skill name, with maximum length of 16 bytes after decoding.
			</xs:documentation>
		</xs:annotation>

		<xs:restriction base="xs:string">
			<xs:maxLength value="16" />
		</xs:restriction>
	</xs:simpleType>


	<xs:simpleType name="symbolType">
        <xs:restriction base="xs:normalizedString">
            <xs:enumeration value="DATA_PROC" />
            <xs:enumeration value="CTRL_PROC" />
            <xs:enumeration value="SPLIT_GATE" />
            <xs:enumeration value="DATA_STORE" />
            <xs:enumeration value="CTRL_STORE" />
            <xs:enumeration value="JOIN_GATE" />
            <xs:enumeration value="BOUNDARY" />
            <xs:enumeration value="TERMINATOR" />
            <xs:enumeration value="CONDITION" />
            <xs:enumeration value="ACTION" />
            <xs:enumeration value="STATE" />
            <xs:enumeration value="DATA_OBJECT" />
            <xs:enumeration value="RELATION" />
            <xs:enumeration value="SUB/SUPER_TYPE" />
            <xs:enumeration value="MODULE" />
            <xs:enumeration value="INCL_MODULE" />
            <xs:enumeration value="TRANSACTION_CENT" />
            <xs:enumeration value="LIB_MODULE" />
            <xs:enumeration value="OFFPAGE_CONN" />
            <xs:enumeration value="ON_PAGE_CONN" />
            <xs:enumeration value="GLOBAL_DATA" />
            <xs:enumeration value="SHARED_DATA" />
            <xs:enumeration value="DATA_FLOW" />
            <xs:enumeration value="CONT_DATA_FLOW" />
            <xs:enumeration value="CTRL_FLOW" />
            <xs:enumeration value="CONT_CTRL_FLOW" />
			<xs:enumeration value="BI_DATA_FLOW" />
            <xs:enumeration value="INIT_TRAN" />
            <xs:enumeration value="TRANSITION" />
            <xs:enumeration value="BI_CONT_DATA_FLOW" />
            <xs:enumeration value="CONNECTION" />
            <xs:enumeration value="ASS_CONNECTION" />
            <xs:enumeration value="SS_CONNECTION" />
			<xs:enumeration value="BI_CTRL_FLOW" />
            <xs:enumeration value="MODULE_CALL" />
            <xs:enumeration value="MODULE_INVOKE" />
            <xs:enumeration value="IT_MODULE_CALL" />
            <xs:enumeration value="BI_CONT_CTRL_FLOW" />
            <xs:enumeration value="DATA_COUPLE" />
            <xs:enumeration value="CTRL_COUPLE" />
            <xs:enumeration value="DIAL_COUPLE" />
            <xs:enumeration value="FN_RETURN" />
            <xs:enumeration value="DSD_OBJECT" />
            <xs:enumeration value="DSD_SEL_OBJECT" />
            <xs:enumeration value="DSD_IT_OBJECT" />
			<xs:enumeration value="D_CONNECTION" />
			<xs:enumeration value="DCD_UNMSECT" />
			<xs:enumeration value="DCD_SECTION" />
			<xs:enumeration value="DCD_CONNECTION" />
            <xs:enumeration value="COMMENT" />
            <xs:enumeration value="EQUIPMENT" />
            <xs:enumeration value="BUS" />
            <xs:enumeration value="LIB_EQUIPMENT" />
            <xs:enumeration value="EQUIPMENT_LINK" />
            <xs:enumeration value="TIME_FUNC" />
            <xs:enumeration value="SHARED_FUNC" />
            <xs:enumeration value="REFERENCE_FUNC" />
            <xs:enumeration value="DISCRETE_ITEM" />
            <xs:enumeration value="TIME_LINE_START" />
            <xs:enumeration value="TIME_LINE_END" />
            <xs:enumeration value="PARALLEL_NODE" />
            <xs:enumeration value="SELECTION_NODE" />
            <xs:enumeration value="ITERATION_NODE" />
            <xs:enumeration value="REPLICATE_NODE" />
            <xs:enumeration value="EXIT_LOOP_NODE" />
            <xs:enumeration value="GOTO_LABEL_NODE" />
            <xs:enumeration value="LABEL_NODE" />
            <xs:enumeration value="DIAG_EXIT_NODE" />
            <xs:enumeration value="EVENT_NODE" />
            <xs:enumeration value="VALID_NODE" />
            <xs:enumeration value="JOIN_NODE" />
            <xs:enumeration value="BD_TERMINATOR" />
            <xs:enumeration value="TIME_LINE" />
            <xs:enumeration value="TIME_LINE_LOOP" />
            <xs:enumeration value="DATA_LINK" />
            <xs:enumeration value="TRIGGER_LINK" />
            <xs:enumeration value="OO_SYSTEM" />
            <xs:enumeration value="EXTERN_ACTOR" />
            <xs:enumeration value="USE_CASE" />
            <xs:enumeration value="SHARED_USE_CASE" />
            <xs:enumeration value="COMM_RELATION" />
            <xs:enumeration value="USES_RELATION" />
            <xs:enumeration value="EXTS_RELATION" />
            <xs:enumeration value="GEN_RELATION" />
            <xs:enumeration value="SYS_PACKAGE" />
            <xs:enumeration value="GLOB_PACKAGE" />
            <xs:enumeration value="PACKAGE_DEPEND" />
            <xs:enumeration value="OBJECT_INSTANCE" />
            <xs:enumeration value="LIFELINE_NODE" />
            <xs:enumeration value="OBJECT_DELETION" />
            <xs:enumeration value="LIFELINE_SCRIPT" />
            <xs:enumeration value="MESSAGE_SEND" />
            <xs:enumeration value="LIFELINE" />
            <xs:enumeration value="ACTIVATION" />
            <xs:enumeration value="COMPUTE_ACTIVE" />
            <xs:enumeration value="SYNCH_MESSAGE" />
            <xs:enumeration value="FLOWCTRL_MESSAGE" />
            <xs:enumeration value="ASYNCH_MESSAGE" />
            <xs:enumeration value="MULT_OBJECT_INST" />
            <xs:enumeration value="INTERACTION_LINK" />
            <xs:enumeration value="C_SYNCH_MSG" />
            <xs:enumeration value="C_FLOW_MSG" />
            <xs:enumeration value="C_ASYNCH_MSG" />
            <xs:enumeration value="GEN_CLASS" />
            <xs:enumeration value="BOUNDARY_CLASS" />
            <xs:enumeration value="CONTROL_CLASS" />
            <xs:enumeration value="ENTITY_CLASS" />
            <xs:enumeration value="TEMPLATE_CLASS" />
            <xs:enumeration value="UTILITY_CLASS" />
            <xs:enumeration value="RELATION_NODE" />
            <xs:enumeration value="BI_ASSOCIATION" />
            <xs:enumeration value="UNI_ASSOCIATION" />
            <xs:enumeration value="BI_AGGREGATION" />
            <xs:enumeration value="UNI_AGGREGATION" />
            <xs:enumeration value="UNI_COMPOSITION" />
            <xs:enumeration value="BI_COMPOSITION" />
            <xs:enumeration value="UNI_COMPOSTION" />
            <xs:enumeration value="INHERITANCE" />
            <xs:enumeration value="CLASS_DEPEND" />
            <xs:enumeration value="ASSOC_CLASS_LNK" />
            <xs:enumeration value="INITIAL_STATE" />
            <xs:enumeration value="FINAL_STATE" />
            <xs:enumeration value="SCD_STATE" />
            <xs:enumeration value="SUPER_STATE" />
            <xs:enumeration value="HISTORY_INDIC" />
            <xs:enumeration value="SCD_TRANSITION" />
            <xs:enumeration value="ACTIVITY" />
            <xs:enumeration value="DEC_ACTIVITY" />
            <xs:enumeration value="SYNCH_BAR" />
            <xs:enumeration value="SIGNAL_SEND" />
            <xs:enumeration value="SIGNAL_RECV" />
            <xs:enumeration value="ACD_TRIGGER" />
            <xs:enumeration value="COMP_SPEC" />
            <xs:enumeration value="TASK_SPEC" />
            <xs:enumeration value="COMP_DEPEND" />
            <xs:enumeration value="PROCESSOR_NODE" />
            <xs:enumeration value="NODE_DEPEND" />
            <xs:enumeration value="SYSTEM_OPERATION" />
            <xs:enumeration value="USER_OPERATION" />
            <xs:enumeration value="AGENT_OPERATION" />
            <xs:enumeration value="GEN_OPERATION" />
            <xs:enumeration value="PFD_TERMINATOR" />
            <xs:enumeration value="HIERARCHY_ITEM" />
            <xs:enumeration value="HIERARCHY_XREF" />
			<xs:enumeration value="IDEF_FUNCTION" />
			<xs:enumeration value="IDEF_FLOW" />
			<xs:enumeration value="TUNNEL_IN_FLOW" />
            <xs:enumeration value="TUNNEL_OUT_FLOW" />
            <xs:enumeration value="PICTURE_SYM" />
            <xs:enumeration value="CIRC_COMPONENT" />
            <xs:enumeration value="RECT_COMPONENT" />
            <xs:enumeration value="TRIA_COMPONENT" />
            <xs:enumeration value="CIRC_ELEMENT" />
            <xs:enumeration value="RECT_ELEMENT" />
            <xs:enumeration value="TRIA_ELEMENT" />
            <xs:enumeration value="ARCH_DATA_LINK" />
            <xs:enumeration value="ARCH_DATA_CHAN" />
            <xs:enumeration value="ARCH_SIG_LINK" />
            <xs:enumeration value="ARCH_SIG_CHAN" />
            <xs:enumeration value="ARCH_SIG_CHAIN" />
            <xs:enumeration value="SAD_PROCESS" />
            <xs:enumeration value="SAD_OBJECT" />
            <xs:enumeration value="SAD_DATA_STORE" />
            <xs:enumeration value="SAD_PROC_ENTRY" />
            <xs:enumeration value="SAD_OBJT_ROUTINE" />
            <xs:enumeration value="EVENT_MESSAGE" />
            <xs:enumeration value="SAD_EVENT" />
            <xs:enumeration value="SAD_MESSAGE" />
            <xs:enumeration value="SAD_RPLY_MESSAGE" />
			<xs:enumeration value="SAD_FIFO_MESSAGE" />
            <xs:enumeration value="SAD_PRTY_MESSAGE" />
            <xs:enumeration value="SAD_DATA_LINK" />
        </xs:restriction>
    </xs:simpleType>

	<!-- Item's Owner/Author attribute. -->
	<xs:simpleType name="itemOwner">
		<xs:annotation>
			<xs:documentation xml:lang="en-gb">
				Item's Owner/Author, with maximum length of 8 bytes after decoding.
			</xs:documentation>
		</xs:annotation>

		<xs:restriction base="xs:string">
			<xs:maxLength value="8" />
		</xs:restriction>
	</xs:simpleType>

    <!-- Item's Status -->
	<xs:simpleType name="itemStatus">
	    <xs:annotation>
	        <xs:documentation>
	            Item's Status, is always 1 character in length.
	        </xs:documentation>
	    </xs:annotation>

        <xs:restriction base="xs:normalizedString">
            <xs:enumeration value=" " />
            <xs:enumeration value="A" />
            <xs:enumeration value="B" />
            <xs:enumeration value="C" />
            <xs:enumeration value="N" />
            <xs:enumeration value="O" />
            <xs:enumeration value="P" />
            <xs:enumeration value="R" />
            <xs:enumeration value="S" />
            <xs:enumeration value="T" />
            <xs:enumeration value="U" />
            <xs:enumeration value="D" />
        </xs:restriction>
    </xs:simpleType>

	<!-- Item's Version attribute. -->
	<xs:simpleType name="itemVersion">
		<xs:annotation>
			<xs:documentation xml:lang="en-gb">
				Item's version, with maximum length of 2 numeric characters.
			</xs:documentation>
		</xs:annotation>

		<xs:restriction base="xs:string">
		    <xs:minLength value="0" />
			<xs:maxLength value="2" />
			<!-- <xs:pattern value="\d{1,2}" /> This is creating a fail case where version is blank -->
		</xs:restriction>
	</xs:simpleType>

	<!-- Specification Type Values -->
	<xs:simpleType name="specType">
		<xs:annotation>
			<xs:documentation>
				Item's Specification Type value.
			</xs:documentation>
		</xs:annotation>

		<xs:restriction base="xs:normalizedString">
			<xs:enumeration value="NODEF" />
			<xs:enumeration value="DD_ENTRY" />
			<xs:enumeration value="PROCESS_SPEC" />
			<xs:enumeration value="STD" />
			<xs:enumeration value="TERMINATOR" />
			<xs:enumeration value="MODULE_SPEC" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Symbol Category Values -->
	<xs:simpleType name="symCat">
	    <xs:annotation>
	        <xs:documentation>
                Item's Symbol Category value.
	        </xs:documentation>
	    </xs:annotation>

        <xs:restriction base="xs:normalizedString">
			<xs:enumeration value="COUPLE" />
			<xs:enumeration value="DATA_AREA" />
			<xs:enumeration value="ENVIRONMENT" />
			<xs:enumeration value="FLOW" />
			<xs:enumeration value="BOUNDARY" />
			<xs:enumeration value="MODULE" />
			<xs:enumeration value="DATA_OBJECT" />
			<xs:enumeration value="PROCESS" />
			<xs:enumeration value="RELATIONSHIP" />
			<xs:enumeration value="STATE" />
			<xs:enumeration value="STORE" />
			<xs:enumeration value="TRANSITION" />
			<xs:enumeration value="CALL" />
			<xs:enumeration value="NODE" />
			<xs:enumeration value="TIME_LINE" />
			<xs:enumeration value="SYSTEM" />
			<xs:enumeration value="USE_CASE" />
			<xs:enumeration value="MESSAGE" />
			<xs:enumeration value="CLASS" />
			<xs:enumeration value="PACKAGE" />
			<xs:enumeration value="XREF_HIER" />
			<xs:enumeration value="GATE" />
			<xs:enumeration value="EQUIPMENT" />
			<xs:enumeration value="INTERFACE" />
			<xs:enumeration value="FUNCTION" />
			<xs:enumeration value="ACTIVITY" />
			<xs:enumeration value="COMPONENT" />
			<xs:enumeration value="OPERATION" />
			<xs:enumeration value="TASK" />
			<xs:enumeration value="ENTRY" />
            <xs:enumeration value="NULL_CAT" />
        </xs:restriction>
	</xs:simpleType>

	<!-- Frame Base Type Options -->
	<xs:simpleType name="frameBaseType">
		<xs:annotation>
			<xs:documentation>
				Frame Base Type options.
			</xs:documentation>
		</xs:annotation>

		<xs:restriction base="xs:normalizedString">
			<xs:enumeration value="FRAME_TYPE_TEXT" />
			<xs:enumeration value="FRAME_TYPE_BINARY" />
			<xs:enumeration value="FRAME_TYPE_PARAM" />
			<xs:enumeration value="FRAME_TYPE_EPS" />
			<xs:enumeration value="FRAME_TYPE_URL" />
			<xs:enumeration value="FRAME_TYPE_GIF" />
			<xs:enumeration value="FRAME_TYPE_JPEG" />
			<xs:enumeration value="FRAME_TYPE_CATEGORY_PICK" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Frame's Desscription attribute. -->
	<xs:simpleType name="frameDescription">
		<xs:annotation>
			<xs:documentation xml:lang="en-gb">
				Frame's name, with maximum length of 255 bytes after decoding.
			</xs:documentation>
		</xs:annotation>

		<xs:restriction base="xs:string">
			<xs:maxLength value="255" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Frame's Command element. -->
	<xs:complexType name="frameCommand">
		<xs:annotation>
			<xs:documentation xml:lang="en-gb">
				Frame's Command. The command is identified by its attributes, e.g. purpose="CHECK" is identifies the command as the one used to check frame contents.
				The type attribute of the command element identifies the application of the command, e.g. type="COMMAND" identifies the basic command, type="DDE_TOPIC" identifies the DDE topic and so on.
			</xs:documentation>
		</xs:annotation>

		<xs:sequence>
			<xs:element name="command_string" minOccurs="0" maxOccurs="5">
				<xs:complexType>
					<xs:simpleContent>
						<xs:extension base="cradle:frameCommandString">
							<xs:attribute name="type" type="cradle:frameCommandStringType" use="required" />
						</xs:extension>
					</xs:simpleContent>
				</xs:complexType>
			</xs:element>
		</xs:sequence>

		<xs:attribute name="dde" type="cradle:yesNo" use="required" />
		<xs:attribute name="purpose" type="cradle:frameCommandPurpose" use="required" />

	</xs:complexType>

	<!-- Frame Command's Purpose. -->
	<xs:simpleType name="frameCommandPurpose">
		<xs:annotation>
			<xs:documentation xml:lang="en-gb">
				Frame's Command Purpose, one of the predefined options.
			</xs:documentation>
		</xs:annotation>

		<xs:restriction base="xs:normalizedString">
			<xs:enumeration value="CHECK" />
			<xs:enumeration value="EDIT" />
			<xs:enumeration value="GET" />
			<xs:enumeration value="SET" />
			<xs:enumeration value="VIEW" />
		</xs:restriction>

	</xs:simpleType>

	<!-- Frame Command's Command String attribute. -->
	<xs:simpleType name="frameCommandString">
		<xs:annotation>
			<xs:documentation xml:lang="en-gb">
				Frame's Command String, with maximum length of 256 bytes after decoding.
			</xs:documentation>
		</xs:annotation>

		<xs:restriction base="xs:string">
			<xs:maxLength value="256" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Frame Command's Command Type. -->
	<xs:simpleType name="frameCommandStringType">
		<xs:annotation>
			<xs:documentation xml:lang="en-gb">
				Frame's Command Type, one of the predefined options.
			</xs:documentation>
		</xs:annotation>

		<xs:restriction base="xs:normalizedString">
			<xs:enumeration value="COMMAND" />
			<xs:enumeration value="DDE_MESSAGE" />
			<xs:enumeration value="DDE_APPLICATION" />
			<xs:enumeration value="DDE_APP_NOT_RUNNING" />
			<xs:enumeration value="TOPIC" />
		</xs:restriction>

	</xs:simpleType>

	<!-- Frame's Name attribute. -->
	<xs:simpleType name="frameName">
		<xs:annotation>
			<xs:documentation xml:lang="en-gb">
				Frame's name, with maximum length of 16 bytes after decoding.
			</xs:documentation>
		</xs:annotation>

		<xs:restriction base="xs:string">
			<xs:maxLength value="16" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Frame Storage Options -->
	<xs:simpleType name="frameStorage">
		<xs:annotation>
			<xs:documentation>
				Item's Frame Storage options.
			</xs:documentation>
		</xs:annotation>

		<xs:restriction base="xs:normalizedString">
			<xs:enumeration value="FRAME_STORE_PDB" />
			<xs:enumeration value="FRAME_STORE_FILE" />
			<xs:enumeration value="FRAME_STORE_CMD" />
			<xs:enumeration value="FRAME_STORE_REF" />
		</xs:restriction>
	</xs:simpleType>



    <!-- BOOL Type -->
    <xs:simpleType name="yesNo">
        <xs:annotation>
            <xs:documentation>
                BOOL Type to define a yes/no capability.
            </xs:documentation>
        </xs:annotation>

        <xs:restriction base="xs:normalizedString">
            <xs:enumeration value="yes" />
            <xs:enumeration value="no" />
        </xs:restriction>
    </xs:simpleType>

    <!-- Project Schema: Category Definition Output to become Object Definitions for 3rd Party XML Formats -->
    <xs:complexType name="categoryDefinition">
        <xs:annotation>
            <xs:documentation>
                Project Schema's Category Definitions, will be referenced to define a Category in an item.
            </xs:documentation>
        </xs:annotation>

		<xs:sequence>
            <xs:element name="description" minOccurs="0" maxOccurs="1" />
			<xs:element name="value" minOccurs="0" maxOccurs="unbounded" />
        </xs:sequence>

		<xs:attribute name="name" use="required" />
		<xs:attribute name="type" type="cradle:categoryType" use="required" />
		<xs:attribute name="mandatory" type="cradle:yesNo" use="required" />
    </xs:complexType>

    <!-- Categories -->
    <xs:complexType name="categories">
        <xs:annotation>
            <xs:documentation>
                Item's Categories, Contains the Items category values.
            </xs:documentation>
        </xs:annotation>

        <xs:sequence>
            <xs:element name="category" maxOccurs="unbounded">
                <xs:complexType mixed="true">
					<xs:sequence>
						<xs:element name="value" minOccurs="0" maxOccurs="unbounded" />
					</xs:sequence>
                    <xs:attribute name="slot" type="xs:integer" />
                    <xs:attribute name="name" />
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>

    <!-- Symbols -->
    <xs:complexType name="symbols">
        <xs:annotation>
            <xs:documentation>
                Items Symbols for Diagrams.
            </xs:documentation>
        </xs:annotation>

        <xs:sequence>
            <xs:element name="symbol" type="cradle:symbol" maxOccurs="unbounded"></xs:element>
        </xs:sequence>
    </xs:complexType>

    <!-- Project Schema: Frame Type Definitions, Will be used to define objects in 3rd party XML formats. -->
    <xs:complexType name="frameType">
        <xs:annotation>
            <xs:documentation>
                Frame Type Definitions, Will be used to define objects in 3rd party XML formats.
            </xs:documentation>
        </xs:annotation>

        <xs:sequence>
            <xs:element name="description" minOccurs="0" maxOccurs="1" type="cradle:frameDescription"/>
            <xs:element name="temp_extension" minOccurs="0" maxOccurs="1" />
			<xs:element name="command" type="cradle:frameCommand" minOccurs="0" maxOccurs="5" />
        </xs:sequence>

		<xs:attribute name="name" use="required" type="cradle:frameName" />
		<xs:attribute name="base_type" use="required" type="cradle:frameBaseType" />
		<xs:attribute name="storage" use="required" type="cradle:frameStorage" />
		<xs:attribute name="mandatory" use="required" type="cradle:yesNo" />
		<xs:attribute name="skill" use="optional" type="cradle:skillName" />
    </xs:complexType>

    <!-- Frames -->
    <xs:complexType name="frames">
        <xs:annotation>
            <xs:documentation>
                Items Frame values. Each frame contains a data element, which contains frame data.
				The form of the data depends on the frame storage type, e.g. encoded binary for binary frames
				stored in PDB, file name for frames stored in files and so on.
            </xs:documentation>
        </xs:annotation>

        <xs:sequence>
            <xs:element name="frame" maxOccurs="unbounded">
                <xs:complexType mixed="true">
                    <xs:sequence>
                        <xs:element name="data" minOccurs="0" maxOccurs="1" /> <!-- This should always contain a CDATA section for IN_PDB storage -->
                        <xs:element name="last_access" minOccurs="0" maxOccurs="1" />
                        <xs:element name="modified" minOccurs="0" maxOccurs="1" />
                        <xs:element name="size" minOccurs="0" maxOccurs="1" />
                    </xs:sequence>
					<xs:attribute name="name" use="required" />
					<xs:attribute name="version" use="required" />
					<xs:attribute name="type" use="required" />
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>

    <!-- Baseline History records. -->
    <xs:complexType name="baselineHistories">
        <xs:annotation>
            <xs:documentation>
                Baseline Histories of items and cross references.
            </xs:documentation>
        </xs:annotation>

        <xs:sequence>
            <xs:element name="baseline_history" type="cradle:baselineHistory" minOccurs="1" maxOccurs="unbounded" />
        </xs:sequence>
    </xs:complexType>

    <!-- Symbols -->
    <xs:complexType name="symbol">
        <xs:annotation>
            <xs:documentation>
                Diagram Symbol definition, will define each symbol on a diagram.
            </xs:documentation>
        </xs:annotation>

        <xs:sequence>
            <xs:element name="number" minOccurs="0" maxOccurs="1" />
            <xs:element name="name" minOccurs="0" maxOccurs="1" />
			<xs:element name="navigation" minOccurs="0" maxOccurs="1" />
            <xs:element name="source_type" minOccurs="0" maxOccurs="1" />
            <xs:element name="source_label" minOccurs="0" maxOccurs="1" />
            <xs:element name="source_role" minOccurs="0" maxOccurs="1" />
            <xs:element name="destination_label" minOccurs="0" maxOccurs="1" />
            <xs:element name="destination_role" minOccurs="0" maxOccurs="1" />
            <xs:element name="source" />
            <xs:element name="destination" />
            <xs:element name="tag" />
            <xs:element name="within" />
            <xs:element name="parameters">
                <xs:complexType>
                    <xs:sequence>
						<!-- TBC - create symbolParameter type. -->
						<xs:element name="parameter" minOccurs="0" maxOccurs="unbounded">
							<xs:complexType>
								<xs:simpleContent>
									<xs:extension base="xs:integer">
										<xs:attribute name="number" type="xs:integer" use="required" />
									</xs:extension>
								</xs:simpleContent>
							</xs:complexType>
						</xs:element>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="flags">
                <xs:complexType>
                    <xs:sequence>
						<!-- TBC - create symbolFlag type. -->
						<xs:element name="flag" minOccurs="0" maxOccurs="unbounded">
							<xs:complexType>
								<xs:simpleContent>
									<xs:extension base="xs:integer">
										<xs:attribute name="number" type="xs:integer" use="required" />
									</xs:extension>
								</xs:simpleContent>
							</xs:complexType>
						</xs:element>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="slice" type="xs:integer" />
            <xs:element name="x_offset" type="xs:integer" />
            <xs:element name="y_offset" type="xs:integer" />
            <xs:element name="fg_colour" minOccurs="0" maxOccurs="1" />
            <xs:element name="bg_colour" minOccurs="0" maxOccurs="1" />
            <xs:element name="definitions" minOccurs="0" maxOccurs="1" />
        </xs:sequence>
        <xs:attribute name="number" type="xs:integer" />	<!-- Symbol's sequence number. -->
		<xs:attribute name="type" type="cradle:symbolType" use="required" />
    </xs:complexType>

    <!-- Environment Conditions -->
    <xs:complexType name="environmentConditions">
        <xs:annotation>
            <xs:documentation>
                Environment Load's Environment Conditions, multiple records.
            </xs:documentation>
        </xs:annotation>

        <xs:sequence>
            <xs:element name="environment_condition" minOccurs="0" maxOccurs="unbounded">
				<xs:complexType>
					<xs:simpleContent>
						<xs:extension base="cradle:itemName">
							<xs:attribute name="sequence_num" type="xs:integer" use="required" />
						</xs:extension>
					</xs:simpleContent>
				</xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>

	<!-- Environment Loads -->
	<xs:complexType name="environmentLoads">
		<xs:annotation>
			<xs:documentation>
				Load Scenario's Environment Loads, multiple records.
			</xs:documentation>
		</xs:annotation>

		<xs:sequence>
			<xs:element name="environment_load" minOccurs="0" maxOccurs="unbounded">
				<xs:complexType>
					<xs:simpleContent>
						<xs:extension base="cradle:itemName">
							<xs:attribute name="sequence_num" type="xs:integer" use="required" />
						</xs:extension>
					</xs:simpleContent>
				</xs:complexType>
			</xs:element>
		</xs:sequence>
	</xs:complexType>

    <!-- Change Task Items Records -->
    <xs:complexType name="chtItems">
        <xs:annotation>
            <xs:documentation>
                Change Task's Item, multiple records.
            </xs:documentation>
        </xs:annotation>

        <xs:sequence>
            <xs:element name="cht_item" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="number" minOccurs="1" maxOccurs="1" />
                        <xs:element name="domain" minOccurs="0" maxOccurs="1" />
						<xs:element name="namespace" minOccurs="0" maxOccurs="1" />
                        <xs:element name="version" minOccurs="1" maxOccurs="1" />
                    </xs:sequence>
                    <xs:attribute name="sequence_no" type="xs:integer" />
					<xs:attribute name="type" type="cradle:cmItemType" use="required" />
					<xs:attribute name="subtype" use="optional" />
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>

    <!-- Environment Conditions: input Conditions multiples declaration -->
    <xs:complexType name="inputConditions">
        <xs:annotation>
            <xs:documentation>
                Input Conditions as multiples for Environment Condition Item Type.
            </xs:documentation>
        </xs:annotation>

        <xs:sequence>
            <xs:element name="input_condition" minOccurs="1" maxOccurs="unbounded">
                <xs:complexType>
					<xs:simpleContent>
						<xs:extension base="cradle:itemName">
							<xs:attribute name="sequence_num" type="xs:integer" use="required" />
						</xs:extension>
					</xs:simpleContent>
				</xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>

    <!-- Model Conditions for State Models -->
    <xs:complexType name="smDiagrams">
        <xs:annotation>
            <xs:documentation>
                State Model Diagrams as multiples for State Model Diagram Type.
            </xs:documentation>
        </xs:annotation>

        <xs:sequence>
            <xs:element name="sm_diagram" minOccurs="1" maxOccurs="unbounded">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="number" type="cradle:itemName" minOccurs="1" maxOccurs="1" />
                        <xs:element name="domain" type="cradle:domain" minOccurs="1" maxOccurs="1" />
                        <xs:element name="namespace" type="xs:string" minOccurs="1" maxOccurs="1" />
                        <xs:element name="version" type="cradle:itemVersion" minOccurs="1" maxOccurs="1" />
                        <xs:element name="draft" type="cradle:itemDraft" minOccurs="1" maxOccurs="1" />
                    </xs:sequence>
					<xs:attribute name="sequence_num" type="xs:integer" use="required" />
					<xs:attribute name="type" type="cradle:diagramType" use="required" />
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>

    <!-- Thread Segments -->
    <xs:complexType name="threadSegments">
        <xs:annotation>
            <xs:documentation>
                Thread Segments as multiples for the Thread Segment Type.
            </xs:documentation>
        </xs:annotation>

        <xs:sequence>
            <xs:element name="thread_segment" minOccurs="1" maxOccurs="unbounded">
				<xs:complexType>
					<xs:simpleContent>
						<xs:extension base="cradle:itemName">
							<xs:attribute name="sequence_num" type="xs:integer" use="required" />
						</xs:extension>
					</xs:simpleContent>
				</xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>

    <!-- Load Scenarios -->
    <xs:complexType name="loadScenarios">
        <xs:annotation>
            <xs:documentation>
                Load Scenario as multiples for the Load Scenario Item Type.
            </xs:documentation>
        </xs:annotation>

		<xs:sequence>
			<xs:element name="load_scenario" minOccurs="0" maxOccurs="unbounded">
				<xs:complexType>
					<xs:simpleContent>
						<xs:extension base="cradle:itemName">
							<xs:attribute name="sequence_num" type="xs:integer" use="required" />
						</xs:extension>
					</xs:simpleContent>
				</xs:complexType>
			</xs:element>
		</xs:sequence>
    </xs:complexType>

    <!-- Item Type -->
    <xs:complexType name="item">
        <xs:annotation>
            <xs:documentation>
                The Item definition, defines an Item in Cradle.
            </xs:documentation>
        </xs:annotation>

        <xs:sequence>
            <xs:element name="fields">
                <xs:complexType>
                    <xs:all>
                        <!-- Core Fields common in the main 6 Item Types -->
                        <xs:element name="number" type="cradle:itemNumber" minOccurs="0" maxOccurs="1" />
                        <xs:element name="name" type="cradle:itemName" minOccurs="0" maxOccurs="1" />
                        <xs:element name="version" type="cradle:itemVersion" minOccurs="0" maxOccurs="1" />
                        <xs:element name="draft" type="cradle:itemDraft" minOccurs="0" maxOccurs="1" />
                        <xs:element name="subtype" type="cradle:noteType" minOccurs="0" maxOccurs="1" />
                        <xs:element name="domain" type="cradle:domain" minOccurs="0" maxOccurs="1" />
                        <xs:element name="model" minOccurs="0" maxOccurs="1" />
                        <xs:element name="author" type="cradle:itemOwner" minOccurs="0" maxOccurs="1" />
                        <xs:element name="pduid" type="cradle:PDUID" minOccurs="0" maxOccurs="1"/>
                        <xs:element name="keyvalue" type="cradle:itemKey" minOccurs="0" maxOccurs="1" />
                        <xs:element name="classification" minOccurs="0" maxOccurs="1" />
                        <xs:element name="owner" type="cradle:itemOwner" minOccurs="0" maxOccurs="1" />
                        <xs:element name="baseline" minOccurs="0" maxOccurs="1" />
                        <xs:element name="status" type="cradle:itemStatus" minOccurs="0" maxOccurs="1" />
                        <xs:element name="modifier" type="cradle:itemOwner" minOccurs="0" maxOccurs="1" />
                        <xs:element name="created_date" type="xs:date" minOccurs="0" maxOccurs="1" />
                        <xs:element name="created_time" type="xs:time" minOccurs="0" maxOccurs="1" />
                        <xs:element name="modified_date" type="xs:date" minOccurs="0" maxOccurs="1" />
                        <xs:element name="modified_time" type="xs:time" minOccurs="0" maxOccurs="1" />
                        <xs:element name="group" minOccurs="0" maxOccurs="1" />
                        <xs:element name="comment" minOccurs="0" maxOccurs="1" />
                        <xs:element name="description" minOccurs="0" maxOccurs="1" />
                        <xs:element name="cclss" minOccurs="0" maxOccurs="1" />
                        <!-- The following fields are all type specific -->
						<!-- Modelling-specific -->
						<xs:element name="namespace" minOccurs="0" maxOccurs="1" />
						<!-- Data Definition-specific -->
						<xs:element name="sym_cat" type="cradle:symCat" minOccurs="0" maxOccurs="1" />
						<!-- Specification-specific -->
						<xs:element name="spec_type" type="cradle:specType" minOccurs="0" maxOccurs="1" />
                        <!-- Baseline Specific -->
                        <xs:element name="close_date" type="xs:date" minOccurs="0" maxOccurs="1" />
                        <xs:element name="close_time" type="xs:time" minOccurs="0" maxOccurs="1" />
                        <xs:element name="close_name" minOccurs="0" maxOccurs="1" />    <!-- CNAME -->
                        <xs:element name="open_date" type="xs:date" minOccurs="0" maxOccurs="1" />
                        <xs:element name="open_time" type="xs:time" minOccurs="0" maxOccurs="1" />
						<xs:element name="title" type="xs:normalizedString" minOccurs="0" maxOccurs="1" />
						<xs:element name="reference" type="xs:normalizedString" minOccurs="0" maxOccurs="1" />
						<xs:element name="purpose" type="xs:normalizedString" minOccurs="0" maxOccurs="1" />
                        <!-- Change Task Specific -->
                        <xs:element name="end_date" type="xs:date" minOccurs="0" maxOccurs="1" />
                        <xs:element name="end_time" type="xs:time" minOccurs="0" maxOccurs="1" />
                        <xs:element name="chr_count" type="xs:integer" minOccurs="0" maxOccurs="1" />   <!-- NMCHR: Number or Associated CHRs -->
                        <!-- Approval Specific -->
                        <xs:element name="team" minOccurs="0" maxOccurs="1" />
                        <xs:element name="info_type" minOccurs="0" maxOccurs="1" />         <!-- INFTP: also in CMLOG -->
                        <xs:element name="info_reference" minOccurs="0" maxOccurs="1" />    <!-- INFRF: also in CMLOG: Should be number -->
						<!-- DTYPE: also in CMLOG -->
                        <xs:element name="diag_spec_draft" minOccurs="0" maxOccurs="1" />   <!-- SPDFT -->
                        <xs:element name="review_date" type="xs:date" minOccurs="0" maxOccurs="1" />    <!-- RDATE -->
                        <!-- Input Conditions Specific -->
                        <xs:element name="flow_name" minOccurs="0" maxOccurs="1" />
                        <!-- CM Log Specific -->
                        <xs:element name="event" minOccurs="0" maxOccurs="1" />             <!-- EVENT: CM Event reference -->
                        <xs:element name="info_subtype" minOccurs="0" maxOccurs="1" />      <!-- INFST: SubType -->
                        <xs:element name="new_owner" minOccurs="0" maxOccurs="1" />         <!-- NOWNR: New Owner -->
                    </xs:all>
                </xs:complexType>
            </xs:element>
            <xs:element name="cht_items" type="cradle:chtItems" minOccurs="0" maxOccurs="1" />
			<xs:element name="cht_chrs" minOccurs="0" maxOccurs="1">
				<!-- CHRXF: Array or CHR Numbers -->
				<xs:complexType>
					<xs:sequence>
						<xs:element name="cht_chr" type="xs:integer" minOccurs="0" maxOccurs="unbounded" />
					</xs:sequence>
				</xs:complexType>
			</xs:element>
			<xs:element name="input_conditions" type="cradle:inputConditions" minOccurs="0" maxOccurs="1" />
			<xs:element name="environment_conditions" type="cradle:environmentConditions" minOccurs="0" maxOccurs="1" />
			<xs:element name="environment_loads" type="cradle:environmentLoads" minOccurs="0" maxOccurs="1" />
			<xs:element name="load_scenarios" type="cradle:loadScenarios" minOccurs="0" maxOccurs="1" />
            <xs:element name="thread_segments" type="cradle:threadSegments" minOccurs="0" maxOccurs="1" />
            <xs:element name="sm_diagrams" type="cradle:smDiagrams" minOccurs="0" maxOccurs="1" />
            <xs:element name="categories" type="cradle:categories" minOccurs="0" maxOccurs="1" />
            <xs:element name="symbols" type="cradle:symbols" minOccurs="0" maxOccurs="1" />
            <xs:element name="frames" type="cradle:frames" minOccurs="0" maxOccurs="1" />
			<!-- Event Specific -->
			<xs:element name="event_before" type="cradle:itemNumber" minOccurs="0" maxOccurs="unbounded" />
        </xs:sequence>
        <xs:attribute name="type" type="cradle:itemType" />
        <xs:attribute name="subtype" />
    </xs:complexType>

    <!-- Project Schema -->
    <xs:complexType name="projectSchema">
        <xs:annotation>
            <xs:documentation>
                Project Schema, will contain information that will become an object but is not the complete Project Schema.
            </xs:documentation>
        </xs:annotation>

        <xs:sequence>
            <xs:element name="categories" minOccurs="0" maxOccurs="1">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="category_definition" type="cradle:categoryDefinition" minOccurs="1" maxOccurs="unbounded" />
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="frames" minOccurs="0" maxOccurs="1">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="frame_type" type="cradle:frameType" minOccurs="1" maxOccurs="unbounded" />
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>

    <!-- Dataset -->
    <xs:complexType name="dataset">
        <xs:annotation>
            <xs:documentation>
                The Dataset definition defines the contents of the project that has been exported.
            </xs:documentation>
        </xs:annotation>

        <xs:sequence>
            <xs:element name="dataset_definition" type="cradle:projectSchema" minOccurs="1" maxOccurs="1" /> <!-- This is the Project Setup Node -->
            <xs:element name="name" type="xs:normalizedString" minOccurs="1" maxOccurs="1" /> <!-- Project Code -->
            <xs:element name="items" minOccurs="0" maxOccurs="1">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="item" type="cradle:item" maxOccurs="unbounded" />
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="xrefs" minOccurs="0" maxOccurs="1">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="xref" type="cradle:xref" maxOccurs="unbounded" />
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="baseline_histories" type="cradle:baselineHistories" minOccurs="0" maxOccurs="1" />
        </xs:sequence>
    </xs:complexType>

    <!-- Cross References -->
    <xs:complexType name="xref">
        <xs:annotation>
            <xs:documentation>
                The Cross Reference representation, used for Current cross references and baselined cross references.
            </xs:documentation>
        </xs:annotation>

        <xs:sequence>
            <xs:element name="from_type" type="xs:normalizedString" />
            <xs:element name="from_subtype" type="xs:normalizedString" />
            <xs:element name="from_number" type="xs:normalizedString" />
            <xs:element name="from_domain" type="xs:normalizedString" />
            <xs:element name="from_namespace" type="xs:normalizedString" />
            <xs:element name="to_type" type="xs:normalizedString" />
            <xs:element name="to_subtype" type="xs:normalizedString" />
            <xs:element name="to_number" type="xs:normalizedString" />
            <xs:element name="to_domain" type="xs:normalizedString" />
            <xs:element name="to_namespace" type="xs:normalizedString" />
			<xs:element name="type" type="xs:normalizedString" />
            <xs:element name="link_type" type="xs:normalizedString" />
            <xs:element name="author" type="xs:normalizedString" />
			<xs:element name="baseline" type="xs:normalizedString" />
			<xs:element name="modifier" type="cradle:itemOwner" minOccurs="0" maxOccurs="1" />
			<xs:element name="created_date" type="xs:date" minOccurs="0" maxOccurs="1" />
			<xs:element name="created_time" type="xs:time" minOccurs="0" maxOccurs="1" />
			<xs:element name="modified_date" type="xs:date" minOccurs="0" maxOccurs="1" />
			<xs:element name="modified_time" type="xs:time" minOccurs="0" maxOccurs="1" />
            <xs:element name="attributes" minOccurs="0" maxOccurs="1">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="attribute" maxOccurs="16" minOccurs="0">
                            <xs:complexType mixed="true">
                                <xs:attribute name="number" type="xs:integer" />
                            </xs:complexType>
                        </xs:element>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>

    <!-- Baseline History -->
    <xs:complexType name="baselineHistory">
        <xs:annotation>
            <xs:documentation>
                Baseline History, will define an item in a baseline.
            </xs:documentation>
        </xs:annotation>

        <xs:sequence>
			<xs:element name="identity" minOccurs="1" maxOccurs="1" />
			<xs:element name="version" minOccurs="1" maxOccurs="1" />
            <xs:element name="status" type="cradle:itemStatus" minOccurs="1" maxOccurs="1" />
            <xs:element name="domain" minOccurs="0" maxOccurs="1" />
            <xs:element name="namespace" minOccurs="0" maxOccurs="1" />
		</xs:sequence>
        <xs:attribute name="baseline" type="xs:normalizedString" />
		<xs:attribute name="type" type="cradle:itemType" use="required" />
		<xs:attribute name="subtype" use="optional" />
    </xs:complexType>

	<!-- XREF Type -->
	<xs:simpleType name="xrefType">
		<xs:annotation>
			<xs:documentation>
				Xref type. One of the predefined values..
			</xs:documentation>
		</xs:annotation>

		<xs:restriction base="xs:normalizedString">
			<xs:enumeration value="STMT_REQ" />
			<xs:enumeration value="STMT_NOTE" />
			<xs:enumeration value="REQ_EVENTS" />
			<xs:enumeration value="EVENTS_ESS_PROC" />
			<xs:enumeration value="REQ_ESS_PROC" />
			<xs:enumeration value="ESS_PROC_IMP_PROC" />
			<xs:enumeration value="EVENT_IMP_MODU" />
			<xs:enumeration value="EVENT_IMP_PROC" />
			<xs:enumeration value="IMP_PROC_IMP_MODU" />
			<xs:enumeration value="REQ_IMP_PROC" />
			<xs:enumeration value="REQ_IMP_MODU" />
			<xs:enumeration value="REQ_REQ" />
			<xs:enumeration value="REQ_NOTE" />
			<xs:enumeration value="EVENT_NOTE" />
			<xs:enumeration value="ESS_PROC_NOTE" />
			<xs:enumeration value="IMP_PROC_NOTE" />
			<xs:enumeration value="IMP_MODU_NOTE" />
			<xs:enumeration value="NOTE_NOTE" />
			<xs:enumeration value="ESS_PROC_ESS_PROC" />
			<xs:enumeration value="IMP_PROC_IMP_PROC" />
			<xs:enumeration value="ESS_DD_NOTE" />
			<xs:enumeration value="IMP_DD_NOTE" />
			<xs:enumeration value="REQ_ESS_DD" />
			<xs:enumeration value="REQ_IMP_DD" />
			<xs:enumeration value="ESS_DD_ESS_DD" />
			<xs:enumeration value="IMP_DD_IMP_DD" />
			<xs:enumeration value="ESS_DD_IMP_DD" />
			<xs:enumeration value="" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Initialise the Document Node -->
<xs:element name="cradle">
    <xs:annotation>
        <xs:documentation>
            The Document Node, the top most node that defines a Cradle XML file.
        </xs:documentation>
    </xs:annotation>

    <xs:complexType>
        <xs:sequence>
            <xs:element name="repository" maxOccurs="1">
                <xs:complexType>
                    <xs:sequence>
						<xs:element name="tool" minOccurs="0" maxOccurs="1"/>
						<xs:element name="timestamp" minOccurs="0" maxOccurs="1"/>
						<xs:element name="author" minOccurs="0" maxOccurs="1"/>
						<xs:element name="comment" minOccurs="0" maxOccurs="1"/>
                        <xs:element name="projects" minOccurs="1" maxOccurs="unbounded">
                            <xs:complexType>
                                <xs:sequence>
                                    <xs:element name="dataset" type="cradle:dataset" minOccurs="1" maxOccurs="unbounded" />
                                </xs:sequence>
                            </xs:complexType>
                        </xs:element>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
</xs:element>
</xs:schema>
