<?xml version="1.0" encoding="utf-8" ?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" 
		xmlns:maml="http://ddue.schemas.microsoft.com/authoring/2003/5" 
		xmlns:doc="http://ddue.schemas.microsoft.com/authoring/internal"
		targetNamespace="http://ddue.schemas.microsoft.com/authoring/2003/5" 
		elementFormDefault="qualified"
        attributeFormDefault="unqualified"
        >

	<!-- Schema documentation -->
	<annotation>
		<documentation>
			This schema definition defines common hierarchy types for the CS Schema.
			This schema is part of the base layer.			
		</documentation>
	</annotation>
	
	<!-- include and import declarations -->
	<include schemaLocation="structure.xsd"/>

    	<complexType name="paraType">
		<sequence>
		    <element ref="maml:para"/>
		</sequence>
		<attributeGroup ref="maml:contentIdentificationSharingAndConditionGroup"/>
	</complexType>

	<complexType name="sectionType">
		<sequence>
		    <element ref="maml:title" minOccurs="0" maxOccurs="1"/>
		    <element ref="maml:content"/>
		    <element ref="maml:sections" minOccurs="0" maxOccurs="1"/>
		</sequence>
		<attributeGroup ref="maml:contentIdentificationSharingAndConditionGroup"/>
	</complexType>
	
	<complexType name="namedSectionType">
		<sequence>
		    <element ref="maml:content"/>
		    <element ref="maml:sections" minOccurs="0" maxOccurs="1"/>
		</sequence>
		<attributeGroup ref="maml:contentIdentificationSharingAndConditionGroup"/>
	</complexType>
    
    <element name="section" type="maml:sectionType">
		<annotation>
			<documentation>
				The section element describes a section within a document.
				The section element supports recursion.
			</documentation>
			<appinfo>
			    <doc:localizable>n/a</doc:localizable>
				<doc:type>section</doc:type>
			</appinfo>
		</annotation>
	</element>

	<element name="sectionSimple" type="maml:sectionContentType">
		<annotation>
			<documentation>
				The sectionSimple element describes a section within a document.
				This element is similar to the section element; however, it is not
				recursive.
			</documentation>
			<appinfo>
			    <doc:localizable>n/a</doc:localizable>
				<doc:type>section</doc:type>
			</appinfo>
		</annotation>
	</element>
	
	<complexType name="sectionsType" mixed="false">
	    <choice minOccurs="0" maxOccurs="unbounded">
            <element ref="maml:section"/>
            <element ref="maml:sectionSimple"/>
            <element name="conditionalSection">
                <complexType>
                    <sequence>
                        <element ref="maml:conditions"/>
                        <element name="conditionalContent" type="maml:sectionsType"/>
                    </sequence>
                </complexType>
            </element>
        </choice>
        <attributeGroup ref="maml:contentIdentificationSharingAndConditionGroup"/>
	</complexType>
	    
	<element name="sections" type="maml:sectionsType">
	    <annotation>
			<documentation>
				This element holds a collection of section elements.
			</documentation>
			<appinfo>
			    <doc:localizable>n/a</doc:localizable>
				<doc:type>section</doc:type>
			</appinfo>
		</annotation>
	</element>
	<element name="sampleRef">
		<annotation>
			<documentation>
				The sampleRef element contains a reference to an external code sample.
			</documentation>
		</annotation>
		<complexType>
			<attribute name="srcID" type="token"/>
			<attribute name="databaseID" type="token"/>
		</complexType>
	</element>
    <group name="relatedTopicLinkGroup">
        <choice>
		<element ref="maml:link"/>
		<element ref="maml:legacyLink"/>
		<element ref="maml:codeEntityReference"/>
		<element ref="maml:externalLink"/>
		<element ref="maml:sampleRef"/>
        </choice>
    </group>

    <complexType name="relatedTopicsType" mixed="false">
        <choice minOccurs="0" maxOccurs="unbounded">
            <group   ref="maml:relatedTopicLinkGroup"/>
        </choice>
        <attributeGroup ref="maml:contentIdentificationSharingAndConditionGroup"/>
    </complexType>
    
	<element name="relatedTopics" type="maml:relatedTopicsType">
		<annotation>
			<documentation>
				The relatedTopicsLink is used to link to other topics that might be interesting to the reader.
			</documentation>
			<appinfo>
			    <doc:localizable>n/a</doc:localizable>
				<doc:type>section</doc:type>
			</appinfo>
		</annotation>
	</element>
	<complexType name="externalResourcesType" mixed="false">
		<sequence>
			<element ref="maml:link"/>
		</sequence>
	</complexType>
	<element name="externalResources" type="maml:externalResourcesType">
		<annotation>
			<documentation>
				This element holds a collection of section elements.
			</documentation>
			<appinfo>
				<doc:localizable>n/a</doc:localizable>
				<doc:type>section</doc:type>
			</appinfo>
		</annotation>
	</element>
	<!-- complexType declarations -->
	<complexType name="contentTypeType">
		<complexContent>
			<extension base="maml:sectionType">
				<sequence>
					<!--<element ref="maml:alertSet" minOccurs="0"/>-->
		                    <element ref="maml:relatedTopics" minOccurs="0" maxOccurs="1"/>
				</sequence>
				<attribute name="contentType" type="token"/>
			</extension>
		</complexContent>
	</complexType>

</schema>