<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

	<xsd:annotation>
		<xsd:documentation xml:lang="en">
		Schema for cheat sheet content file.
 		Copyright (c) 2004, 2005 IBM Corporation and others.&lt;br&gt;
		All rights reserved. This program and the accompanying materials are made 
		available under the terms of the Eclipse Public License v1.0 which 
		accompanies this distribution, and is available at 
		&lt;a href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
		</xsd:documentation>
	</xsd:annotation>

    <xsd:element name="cheatsheet">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element maxOccurs="1" minOccurs="1" ref="intro"/>
                <xsd:element maxOccurs="unbounded" minOccurs="1" ref="item"/>
            </xsd:sequence>
            <xsd:attribute name="title" type="xsd:string" use="required"/>
        </xsd:complexType>
    </xsd:element>
    
    <xsd:element name="intro">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element ref="description" minOccurs="1" maxOccurs="1"/>
            </xsd:sequence>
            <xsd:attribute name="contextId" type="xsd:string" use="optional"/>
            <xsd:attribute name="href" type="xsd:string" use="optional"/>
        </xsd:complexType>
    </xsd:element>
      
    <xsd:element name="description">
        <xsd:complexType>
            <xsd:simpleContent>
                <xsd:extension base="string"/>
            </xsd:simpleContent>
        </xsd:complexType>
    </xsd:element> 
    
    <xsd:element name="onCompletion">
        <xsd:complexType>
            <xsd:simpleContent>
                <xsd:extension base="string"/>
            </xsd:simpleContent>
        </xsd:complexType>
    </xsd:element>

    <xsd:element name="item">
        <xsd:complexType mixed="true">
            <xsd:choice maxOccurs="1" minOccurs="1">
	            <xsd:sequence>
	                <xsd:element ref="description"/>
		            <xsd:choice minOccurs="0" maxOccurs="1">
		                <xsd:element ref="action"/>
		                <xsd:element ref="command"/>
		                <xsd:element ref="perform-when"/>
		            </xsd:choice>
		            <xsd:element minOccurs="0" maxOccurs="1" ref="onCompletion"/>
	            </xsd:sequence>
	            <xsd:choice maxOccurs="unbounded" minOccurs="0">
	                <xsd:element ref="subitem"/>
	                <xsd:element ref="conditional-subitem"/>
	                <xsd:element ref="repeated-subitem"/>
	            </xsd:choice>
            </xsd:choice>
            <xsd:attribute name="title" type="xsd:string" use="required"/>
            <xsd:attribute name="dialog" type="xsd:boolean" use="optional" default="false"/>
            <xsd:attribute name="skip" type="xsd:boolean" use="optional" default="false"/>
            <xsd:attribute name="contextId" type="xsd:string" use="optional"/>
            <xsd:attribute name="href" type="xsd:string" use="optional"/>
        </xsd:complexType>
    </xsd:element>
    
    <xsd:element name="subitem">
        <xsd:complexType>
            <xsd:choice minOccurs="0" maxOccurs="1">
                <xsd:element ref="action"/>
                <xsd:element ref="command"/>
                <xsd:element ref="perform-when"/>
            </xsd:choice>
            <xsd:attribute name="label" type="xsd:string" use="required"/>
            <xsd:attribute name="kind" type="ActionKind" use="required"/>
            <xsd:attribute name="skip" type="xsd:boolean" use="optional" default="false"/>
        </xsd:complexType>
    </xsd:element>

    <xsd:element name="conditional-subitem">
        <xsd:complexType>
           <xsd:sequence>
                <xsd:element ref="subitem" minOccurs="1" maxOccurs="unbounded"/>
            </xsd:sequence>
            <xsd:attribute name="condition" type="xsd:string" use="required"/>
        </xsd:complexType>
    </xsd:element>

    <xsd:element name="repeated-subitem">
        <xsd:complexType>
           <xsd:sequence>
                <xsd:element ref="subitem" minOccurs="1" maxOccurs="1"/>
            </xsd:sequence>
            <xsd:attribute name="values" type="xsd:string" use="required"/>
        </xsd:complexType>
    </xsd:element>

    <xsd:element name="action">
        <xsd:complexType>
            <xsd:attribute name="when" type="xsd:string" use="required"/>
            <xsd:attribute name="confirm" type="xsd:boolean" use="optional" default="false"/>
            <xsd:attribute name="class" type="xsd:string" use="optional"/>
            <xsd:attribute name="pluginId" type="xsd:string" use="optional"/>
            <xsd:attribute name="param1" type="xsd:string" use="optional"/>
            <xsd:attribute name="param2" type="xsd:string" use="optional"/>
            <xsd:attribute name="param3" type="xsd:string" use="optional"/>
            <xsd:attribute name="param4" type="xsd:string" use="optional"/>
            <xsd:attribute name="param5" type="xsd:string" use="optional"/>
            <xsd:attribute name="param6" type="xsd:string" use="optional"/>
            <xsd:attribute name="param7" type="xsd:string" use="optional"/>
            <xsd:attribute name="param8" type="xsd:string" use="optional"/>
            <xsd:attribute name="param9" type="xsd:string" use="optional"/>
        </xsd:complexType>
    </xsd:element>
    
    <xsd:element name="command">
        <xsd:complexType>
            <xsd:attribute name="when" type="xsd:string" use="required"/>
            <xsd:attribute name="confirm" type="xsd:boolean" use="optional" default="false"/>
            <xsd:attribute name="serialization" type="xsd:string" use="optional"/>
            <xsd:attribute name="returns" type="xsd:string" use="optional"/>
        </xsd:complexType>
    </xsd:element>
    
    <xsd:element name="perform-when">
        <xsd:complexType>
           <xsd:sequence>
	           <xsd:choice minOccurs="1" maxOccurs="unbounded">
	                <xsd:element ref="action" />
	                <xsd:element ref="command"/>
	            </xsd:choice>
            </xsd:sequence>
            <xsd:attribute name="condition" type="xsd:string" use="required"/>
        </xsd:complexType>
    </xsd:element>

</xsd:schema>

