<?xml version="1.0" encoding="UTF-8"?>
<!-- 
// Description: designConfig.xsd
// Author: The SPIRIT Consortium Schema Working Group
// 
// Revision:    $Revision: 1235 $
// Date:        $Date: 2008-04-03 12:08:47 -0500 (Thu, 03 Apr 2008) $
// 
// Copyright (c) 2005, 2006, 2007, 2008 The SPIRIT Consortium.
// 
// This work forms part of a deliverable of The SPIRIT Consortium.
// 
// Use of these materials are governed by the legal terms and conditions
// outlined in the 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 and its members harmless from any damages or liability.
// Users are requested to provide feedback to The SPIRIT Consortium
// using either mailto:feedback@lists.spiritconsortium.org or the forms at 
// http://www.spiritconsortium.org/about/contact_us/
// 
// This file may be copied, and distributed, WITHOUT
// modifications; this notice must be included on any copy.
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:spirit="http://www.spiritconsortium.org/XMLSchema/SPIRIT/1.5" targetNamespace="http://www.spiritconsortium.org/XMLSchema/SPIRIT/1.5" elementFormDefault="qualified" attributeFormDefault="qualified">
    <xs:include schemaLocation="commonStructures.xsd"/>
    <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 ref="spirit:configurableElementValues"/>
                        </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, monitor interconnection name or possibly a 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 ref="spirit:displayName" minOccurs="0"/>
                                                    <xs:element ref="spirit:description" minOccurs="0"/>
                                                    <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 ref="spirit:description" minOccurs="0"/>
                <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>
