<?xml version="1.0" encoding="UTF-8"?>
<!-- 
// Description: designConfig.xsd
// Author: The SPIRIT Consortium Schema Working Group
// Version:     $Revision: 1121 $
// Date:        $Date: 2008-01-30 13:48:22 -0800 (Wed, 30 Jan 2008) $
// Tag:         $Name$
//
// Copyright (c) 2005, 2006, 2007 The SPIRIT Consortium.  All rights reserved.
// www.spiritconsortium.org
//
// THIS WORK FORMS PART OF A SPIRIT CONSORTIUM SPECIFICATION.
// USE OF THESE MATERIALS ARE GOVERNED BY
// THE LEGAL TERMS AND CONDITIONS OUTLINED IN THE SPIRIT
// SPECIFICATION DISCLAIMER AVAILABLE FROM
// www.spiritconsortium.org
//
// This source file is provided on an AS IS basis. The SPIRIT Consortium disclaims 
// ANY WARRANTY EXPRESS OR IMPLIED INCLUDING ANY WARRANTY OF
// MERCHANTABILITY AND FITNESS FOR USE FOR A PARTICULAR PURPOSE. 
// The user of the source file shall indemnify and hold The SPIRIT Consortium harmless
// from any damages or liability arising out of the use thereof or the performance or
// implementation or partial implementation of the schema.
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:spirit="http://www.spiritconsortium.org/XMLSchema/SPIRIT/1.4" targetNamespace="http://www.spiritconsortium.org/XMLSchema/SPIRIT/1.4" elementFormDefault="qualified" attributeFormDefault="qualified">
    <xs:include schemaLocation="identifier.xsd"/>
    <xs:include schemaLocation="model.xsd"/>
    <xs:include schemaLocation="subInstances.xsd"/>
    <xs:element name="designConfiguration">
        <xs:annotation>
            <xs:documentation>Top level element for describing the current configuration of a design. Does not describe instance parameterization</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:group ref="spirit:versionedIdentifier"/>
                <xs:element name="designRef" type="spirit:libraryRefType">
                    <xs:annotation>
                        <xs:documentation>The design to which this configuration applies</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element name="generatorChainConfiguration" minOccurs="0" maxOccurs="unbounded">
                    <xs:annotation>
                        <xs:documentation>Contains the configurable information associated with a generatorChain and its generators. Note that configurable information for generators associated with components is stored in the design file.</xs:documentation>
                    </xs:annotation>
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="generatorChainRef" type="spirit:libraryRefType">
                                <xs:annotation>
                                    <xs:documentation>References a generatorChain.</xs:documentation>
                                </xs:annotation>
                            </xs:element>
                            <xs:element name="generators" minOccurs="0" maxOccurs="unbounded">
                                <xs:annotation>
                                    <xs:documentation>Stores configurable information for generators referenced in the chain</xs:documentation>
                                </xs:annotation>
                                <xs:complexType>
                                    <xs:sequence>
                                        <xs:element name="generatorName" type="xs:string">
                                            <xs:annotation>
                                                <xs:documentation>This identifies the generator in the chain.</xs:documentation>
                                            </xs:annotation>
                                        </xs:element>
                                        <xs:element ref="spirit:configurableElementValues" minOccurs="0"/>
                                    </xs:sequence>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <xs:element name="interconnectionConfiguration" minOccurs="0" maxOccurs="unbounded">
                    <xs:annotation>
                        <xs:documentation>Contains the information about the abstractors required to cross between two interfaces at with different abstractionDefs.</xs:documentation>
                    </xs:annotation>
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="interconnectionRef" type="xs:Name">
                                <xs:annotation>
                                    <xs:documentation>Reference to the interconnection name or possibly an hierConnection interfaceName in a design file.</xs:documentation>
                                </xs:annotation>
                            </xs:element>
                            <xs:element name="abstractors">
                                <xs:annotation>
                                    <xs:documentation>List of abstractors for this interconnection</xs:documentation>
                                </xs:annotation>
                                <xs:complexType>
                                    <xs:sequence>
                                        <xs:element name="abstractor" maxOccurs="unbounded">
                                            <xs:annotation>
                                                <xs:documentation>Element to hold a the abstractor reference, the configuration and viewName. If multiple elements are present then the order is the order in which the abstractors should be chained together.</xs:documentation>
                                            </xs:annotation>
                                            <xs:complexType>
                                                <xs:sequence>
                                                    <xs:element name="instanceName" type="xs:Name">
                                                        <xs:annotation>
                                                            <xs:documentation>Instance name for the abstractor</xs:documentation>
                                                        </xs:annotation>
                                                    </xs:element>
                                                    <xs:element name="displayName" type="xs:string" minOccurs="0">
                                                        <xs:annotation>
                                                            <xs:documentation>Display name for the abstractor instance.</xs:documentation>
                                                        </xs:annotation>
                                                    </xs:element>
                                                    <xs:element name="description" type="xs:string" minOccurs="0">
                                                        <xs:annotation>
                                                            <xs:documentation>String for describing this abstractor instance to users</xs:documentation>
                                                        </xs:annotation>
                                                    </xs:element>
                                                    <xs:element name="abstractorRef" type="spirit:libraryRefType">
                                                        <xs:annotation>
                                                            <xs:documentation>Abstractor reference</xs:documentation>
                                                        </xs:annotation>
                                                    </xs:element>
                                                    <xs:element ref="spirit:configurableElementValues" minOccurs="0"/>
                                                    <xs:element name="viewName" type="xs:NMTOKEN">
                                                        <xs:annotation>
                                                            <xs:documentation>The name of the active view for this abstractor instance.</xs:documentation>
                                                        </xs:annotation>
                                                    </xs:element>
                                                </xs:sequence>
                                            </xs:complexType>
                                        </xs:element>
                                    </xs:sequence>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <xs:element name="viewConfiguration" minOccurs="0" maxOccurs="unbounded">
                    <xs:annotation>
                        <xs:documentation>Contains the active view for each instance in the design</xs:documentation>
                    </xs:annotation>
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element ref="spirit:instanceName"/>
                            <xs:element name="viewName" type="xs:NMTOKEN">
                                <xs:annotation>
                                    <xs:documentation>The name of the active view for this instance</xs:documentation>
                                </xs:annotation>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <xs:element name="description" type="xs:string" minOccurs="0">
                    <xs:annotation>
                        <xs:documentation>String for describing this design configuration to users</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element ref="spirit:vendorExtensions" minOccurs="0"/>
            </xs:sequence>
        </xs:complexType>
        <xs:key name="designConfigViewInstanceKey">
            <xs:selector xpath="spirit:viewConfiguration"/>
            <xs:field xpath="spirit:instanceName"/>
        </xs:key>
        <xs:key name="designConfigAbstractorInstanceKey">
            <xs:selector xpath="spirit:interconnectionConfiguration/spirit:abstractors/spirit:abstractor"/>
            <xs:field xpath="spirit:instanceName"/>
        </xs:key>
        <xs:key name="designConfigInterconnectionRefKey">
            <xs:selector xpath="spirit:interconnectionConfiguration"/>
            <xs:field xpath="spirit:interconnectionRef"/>
        </xs:key>
    </xs:element>
</xs:schema>
